1

Can I set a background image to the actionbar but without it fitting the size off the image? I want to set the background and to fit the image in the actionbar size. How can I do that?

dephinera
  • 3,703
  • 11
  • 41
  • 75

1 Answers1

0
 final ActionBar actionBar = getActionBar(); 

 BitmapDrawable background = new BitmapDrawable (BitmapFactory.decodeResource(getResources(),   
 R.raw.actionbar_background)); 

 background.setTileModeX(android.graphics.Shader.TileMode.REPEAT); 

 actionBar.setBackgroundDrawable(background);

See this

Community
  • 1
  • 1
Naveen Tamrakar
  • 3,349
  • 1
  • 19
  • 28
  • new BitmapDrawable (BitmapFactory.decodeResource(getResources(), R.raw.actionbar_background)); is deprecated – dephinera Sep 02 '14 at 10:12