Toast size on Galaxy Nexus

2019-02-22 16:36发布

When I use toasts in my app, the size is very very small. But when another app displays a toast, the size is normal (like Advanced Task Killer, or SMS).

What do I have to do to get normally-sized toasts?

I have a Galaxy Nexus ICS=4.0.1, and my app is using SDK API level 7 (android 2.1+).

4条回答
霸刀☆藐视天下
2楼-- · 2019-02-22 17:20

Thank you ! (x1000)

Adding

    <supports-screens android:resizeable="true"
                  android:smallScreens="true"
                  android:normalScreens="true"
                  android:largeScreens="true"
                  android:anyDensity="true"/>

to my manifest, solved my problem...

查看更多
Melony?
3楼-- · 2019-02-22 17:25

I finally fixed this by removing android:anyDensity="false" from my supports-screens element in my manifest. I'm not sure why I had it there in the first place, except that I started that app from one of my rather old apps instead of from scratch.

That setting also caused my activity to be realllllly small (order the order of 25px by 20px) when I ran with targetSdkVersion 14 or 15 on my nexus. Seems like a bug.

查看更多
爱情/是我丢掉的垃圾
4楼-- · 2019-02-22 17:26

you may need to use a Custom ToastView

查看更多
forever°为你锁心
5楼-- · 2019-02-22 17:30

Maybe this is a theme problem... Can you try to implement Using Holo while supporting Android 2.x in this post ?

查看更多
登录 后发表回答