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?
Asked
Active
Viewed 3,566 times
1
-
did you tried anything?if yes post your code – yuva ツ Sep 02 '14 at 09:48
-
Deplicated http://stackoverflow.com/questions/5861870/actionbar-background-image – Naveen Tamrakar Sep 02 '14 at 09:49
-
check: http://stackoverflow.com/questions/8024706/how-do-i-change-the-background-color-of-the-actionbar-of-an-actionbaractivity-us – Vikas B L Sep 02 '14 at 10:06
1 Answers
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);

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