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.
精彩评论