我正在尝试为布局加载一个不同的XML文件,并在Android中尺寸。我尝试过创建一个Xlarge文件夹(用于10英寸平板电脑)和大文件夹(用于7英寸平板电脑)。因此,该文件夹称为values-xlarge和values-large或values-xlarge和值。 10英寸平板电脑的密度为224 ppi。
如果我使用这些布局文件,则使用10英寸平板电脑的“值”文件夹中的布局文件。如何为7英寸和10英寸平板电脑加载其他设计?以及哪个附录应用于文件夹?我发现小,中等,...,SW700DP,SW600DP和MDPI,HDPI等。
I am trying to load a different xml file for the layout and dimens in Android. I have tried creating an xlarge folder (for 10 inch tablet) and large folder (for 7 inch tablet). So the folder are called values-xlarge and values-large or values-xlarge and values-large. The 10 inch tablet has a density of 224 ppi.
If I use these layout files, the layout file from the values-large folder is used for the 10 inch tablet. How can I load a different design for 7 and 10 inch tablets? And which appendix should be used to the folder? I have found small, medium, large, ..., sw700dp, sw600dp and mdpi, hdpi, etc.
发布评论
评论(1)
我使用sw720dp,sw350dp-land,sw350dp等。
文件夹中的布局将用于最小宽度(SW ...)为720dp等的屏幕。 SW700DP将用于具有700DP或更多或更高的屏幕,直到下一个SW?DP布局。
它在显示独立的像素中,而不是常规像素。 IE。像素宽度除以屏幕DPI。您还可以在景观或肖像时添加一个或 - 端口以仅使用此布局。
查看此链接以获取更多信息。
I use sw720dp, sw350dp-land, sw350dp, etc.
The layout in the folder will be used for a screen with the smallest width (sw...) of 720dp, etc. ie. sw700dp will be used for screens with 700dp or more or up until the next sw???dp layout.
It is in Display Independent Pixels, not regular pixels. ie. pixel width divided by the screen dpi. You can also add a -land or -port to only use this layout if it is landscape or portrait.
Check out this link for more information.
https://developer.android.com/guide/topics/large-screens/support-different-screen-sizes