sw600dp quantifier not working on Galaxy Tab

爷,独闯天下 提交于 2019-11-29 00:10:11

问题


I have a program with 2 fragments. On tablets I am showing both of them.
I am doing this with /layout-sw600dp folder.
On Motorola Xoom and other tablets it is working but not in Samsung Galaxy Tab 10.1
This is very strange. I have searched everywhere and havent come accross with a person with the same problem?
What can be the reason?


回答1:


Might as well put this as an answer. The swXXXdp identifiers are only for Android 3.2 and above. If you want to make sure you properly target tablets both post- and pre-3.2, you must use the swXXXdp attribute and large/xlarge attributes. So for an example:

  • /layout/ -- for phone devices and portrait tablets
  • /layout-xlarge-land/ for landscape tablets pre-3.2
  • /layout-sw600dp-land/ for landscape tablets post-3.2

Before Honeycomb 3.2, Android used "size buckets" of small (e.g. Wildfire), normal (basically any phone), large (Streak 5, OG Galaxy Tab), xlarge (Xoom), but now ditches them in favour of these dp values which allow finer control.




回答2:


If you need support for 7 inch tables, then it is not xlarge but large: /layout/ -- for phone devices and portrait tablets /layout-large-land/ for landscape tablets pre-3.2 /layout-sw600dp-land/ for landscape tablets post-3.2



来源:https://stackoverflow.com/questions/8926281/sw600dp-quantifier-not-working-on-galaxy-tab

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