编辑:这不是重复张贴。我的问题不是如何为ANDROID实现不同的布局分辨率,而是如何以不同的分辨率动态列出产品,从而填补所需的空间。目前,4行产品显示在10英寸的显示器上,4行显示在7英寸上。这意味着用户需要在7英寸上垂直滚动以查看所有内容。我希望产品动态填充空间,不需要垂直滚动。谢谢你提前提供帮助。
我正在帮助编写一个Android应用程序。在10英寸的平板电脑中,我有4行产品展示(这是我想要的)。在7英寸,我应该只有3行产品显示,但现在显示4行(如10英寸平板电脑),这是一个垂直滚动。是否有可能在7英寸平板电脑上只显示3行代码?
我的产品只按预期向右和向左移动--它不应该有垂直滚动。
更具体地说,问题是:是否可以在10英寸平板电脑中动态显示4行产品,而在7英寸上只显示3行产品。为7英寸选定的布局很大。
发布于 2013-04-23 18:27:45
您需要7英寸和10英寸的单独布局。
7英寸片
10英寸片
更新示例
res/layout this is the default, it is needed even if you don't plan to support phones!For 3.2及以上版本安卓版本( >= 3.2 )
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)低于3.2VersionAndroid版本的(< 3.2 )
res/layout-large # for 7" tablet (works on emulator and nexus7)
res/layout-xlarge # for 10" tablet (works on emulator and galaxytab10.1)https://stackoverflow.com/questions/16176481
复制相似问题