简体   繁体   English

如何使10英寸平板电脑代码与Android中的7英寸平板电脑兼容

[英]How make 10 inch tablet code compatible to 7 inch tablet in android

我有10英寸平板电脑的源代码,我如何使它适合7英寸平板电脑而不改变布局等。

You can not direct assume that 10 inch tablet Layout will work same as on 7 inch Tablet .You have to make some changes to work on both like following from android Developer Site. 您不能直接假设10英寸平板电脑布局与7英寸平板电脑上的工作方式相同。您必须对这两个工具进行一些更改,例如以下来自android Developer Site。

For other cases in which you want to further customize your UI to differentiate between sizes such as 7” and 10” tablets, you can define additional smallest width layouts: 对于您希望进一步自定义UI以区分尺寸(例如7“和10”平板电脑)的其他情况,您可以定义其他最小宽度布局:

res/layout/main_activity.xml           # For handsets (smaller than 600dp available width)
res/layout-sw600dp/main_activity.xml   # For 7” tablets (600dp wide and bigger)
res/layout-sw720dp/main_activity.xml   # For 10” tablets (720dp wide and bigger)

Notice that the previous two sets of example resources use the "smallest width" qualifer, swdp, which specifies the smallest of the screen's two sides, regardless of the device's current orientation. 请注意,前两组示例资源使用“最小宽度”限定符swdp,它指定屏幕两侧的最小值,而不管设备的当前方向如何。 Thus, using swdp is a simple way to specify the overall screen size available for your layout by ignoring the screen's orientation. 因此,使用swdp是一种通过忽略屏幕方向来指定布局可用的整体屏幕大小的简单方法。

For Detail You can Refer Developer Site Link here 详细信息您可以在此处参阅开发者站点链接

EDIT: 编辑:

Please Refer this SO Link for Use of Drawable in all types Layout. 请参阅此SO链接以使用所有类型布局中的Drawable。 Click here 点击这里

Here is one more reference Guide for Understanding work with Multiple Screen In android,documents from Motorola Click here 这里有一个参考指南,用于了解多屏幕工作在Android中,来自摩托罗拉的文档点击此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM