App logo in actionbar appears larger on tablet vs

2019-08-31 07:38发布

问题:

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.