App logo in actionbar appears larger on tablet vs phone

感情迁移 提交于 2019-12-11 18:14:36

问题


I'm having trouble figuring out why my app logo in the actionbar appears larger on a nexus 7 vs a nexus 5. I'm using the actionbar in the support library. They're both running android 4.2.2

Nexus 5 (good)

Nexus 7 (bad)

Here are the logo image resources.

What can I do to fix?


回答1:


The problem because of different dimension of the devices.You can fix it by alter your images for two different dpi.xhdpi for nexus 7 under the resolution of 1920 x 1200 pixels rate.xxhdpi for nexus 5 under the resolution of 1080 x 1920 pixels rate.




回答2:


Just a shot in the dark: Do you have any different layouts or drawables based on the dpi like xhdpi or xxhdpi ? nexus 5 comes under xxhdpi whereas nexus 7 is xhdpi.So if you are setting the resources differently, that could be your issue.



来源:https://stackoverflow.com/questions/22140135/app-logo-in-actionbar-appears-larger-on-tablet-vs-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!