开发者

Android title bar icon size

Is it possible to specify the size for the icon for the android title bar?

 requestWindowFeature(Window.FEATURE_LEFT_ICON);
 setContentView(R.layout.main);
 setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.logo开发者_如何学Python);


If this question is about changing the size of an icon based on the resolution of the screen, you can make the image have multiple different sizes, name them all the same (for example, my_image.png), and put them in the appropriate res/drawable (default), res/drawable-hdpi (high dpi screens), etc. folders. Then you just request the image with:

Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.my_image);

which will return the appropriate image version for the screen.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜