Java 支持具有多个布局的屏幕清单
我发现,但我不清楚的是; 当有很多带有片段的布局时,如何添加Java 支持具有多个布局的屏幕清单,java,android,compatibility,android-studio-3.0,Java,Android,Compatibility,Android Studio 3.0,我发现,但我不清楚的是; 当有很多带有片段的布局时,如何添加 /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 /res/layout-small-land/layout.xml
/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
/res/layout-small-land/layout.xml // Small screens, landscape view
/res/layout-small-portrait/layout.xml // Small screens, portrait view
要使应用程序与任何屏幕大小兼容?同样对于一个用户界面,是否需要设计屏幕大小的所需视图x6(布局、小、大、xlarge、小范围、小纵向)倍 这应该会有帮助:谢谢你,我已经注意到了。而不是使用它,但我关心的是使用“据我所知,需要为不同的尺寸定义所述布局。如果是这样,当有多个布局时,是否需要为每个UI创建四次布局?不,您不需要这样做。我通常只是在不同的屏幕尺寸上测试它们,如果我看到一些不合适或需要修复。我将UI布局复制到文件夹中,然后修改需要修复的内容。有时,您可以使用不同的尺寸文件,而不必使用全新的布局。有关如何使用尺寸Mm的示例,请参见本页的答案。。我得到了它。谢谢你的推荐。
You can check this :
res/layout/main_activity.xml # For handsets
res/layout-land/main_activity.xml # For handsets in landscape
res/layout-sw600dp/main_activity.xml # For 7” tablets
res/layout-sw600dp-land/main_activity.xml # For 7” tablets in landscape