开发者

Android title bar icon size

开发者 https://www.devze.com 2023-03-16 06:23 出处:网络
Is it possible to specify the size for the icon for the android title bar? requestWindowFeature(Window.FEATURE_LEFT_ICON);

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

精彩评论

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

关注公众号