Support-Screens in Manifest File

北城余情 提交于 2019-12-01 15:27:50

问题


This is my code in my android manifest file.

supports-screens android:resizeable="true"
              android:smallScreens="true"
              android:normalScreens="true"
              android:largeScreens="true"
              android:xlargeScreens="true"
              android:anyDensity="true"

What I understand from supportscreens is that it can be used to simply fit the app screen onto the multiple screen sizes done by resizing it and stretching the image. However, I don't see any difference with or without this code. Can anyone help me?


回答1:


Just Like this:

 /res/layout/layout.xml         // Default layout
 /res/layout-small/layout.xml   // Small screens
 /res/layout-large/layout.xml   // Large screens
 /res/layout-xlarge/layout.xml  // Ex

You can go even further and make also different layouts for portrait and landscape views by specyfing another keyword in directory's name:

 /res/layout-small-land/layout.xml      // Small screens, landscape view
 /res/layout-small-portrait/layout.xml  // Small screens, portrait view

Remember that tags order is important, so you can't write layout-portrait-small.

And in last add this code to your manifest file:

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



回答2:


Please have a look at the Android Training site for "Designing for Multiple Screens"



来源:https://stackoverflow.com/questions/17463634/support-screens-in-manifest-file

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