本文介绍了如何创建不同布局的Galaxy S3和Nexus 7?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个Android应用程序,它可以正常使用承上启下7。内部资源的文件夹,我创建了两个文件夹,布局布局陆的的Nexus 7选项卡。一切工作。细直到日期现在我想创建一个不同的布局,三星Galaxy S3对于这一点,我已经创建了内部资源的文件夹与布局大&安培; 布局大的土地,但是,现在的问题是,现在的的Nexus 7还,在布局大文件夹中定义的布局是越来越加载如何阻止我如何可以创建不同布局的Nexus 7标签及放大器。?;银河S3手机?我已阅读支持多画面文档。但我不明白的屏幕尺寸的Nexus 7是1204 * 800和放大器;屏幕尺寸为三星Galaxy S3为720×1280。

I have created an android application which works properly for nexus 7.Inside resources folder, I have created two folders, layout, layout-land for Nexus 7" tab. Everything was working fine till date. Now I want to create a different layout for Samsung Galaxy S3. For that, I have created a folders inside resources with layout-large & layout-large-land. But, here is the problem. Now, for Nexus 7 also, the layout defined in layout-large folder is getting loaded. How to stop that? How can I create different layout for Nexus 7" tab & Galaxy S3 mobile? I have read Supporting Multiple Screens documentation. But I couldn't understand as the screen size for Nexus 7 is 1204 X 800 & screen size for samsung galaxy S3 is 720 X 1280.

如何创建不同的布局不同的屏幕分辨率和放大器不同设备;显示尺寸?另外,根据设备尺寸,我想改变我的应用程序数的值。那怎么办呢?

How to create different layouts for different devices with different screen resolutions & display sizes? Also, based on device size, I want to change few values in my application. How to do that one?

推荐答案

按照支持多画面

According to the Supporting Multiple Screens

像预选赛正常 XLARGE 屏幕尺寸,这意味着的Nexus 7将使用的资源与预选赛,如果你提供。创建具有文件夹因此前大型预选赛,的Nexus 7会从默认的布局文件夹中加载的资源。至于 LDPI MDPI 华电国际 xhdpi 是屏幕像素密度。

Qualifiers like small, normal, large and xlarge is for Screen Sizes, which means Nexus 7 will use the resources with large qualifier, if you provide. Therefore before you create the folder with large qualifier, Nexus 7 will load the resources from default layout folder. As for ldpi, mdpi, hdpi and xhdpi is for the screen density.

要解决你的问题,你需要:

To solve your problem, you need:

  1. 将布局定义的Galaxy S3到布局,布局sw600dp的的Nexus 7,请参考Android开发者博客:Getting您的应用程序准备果冻豆和Nexus 7

把资源(图像或绘制的东西),银河S3将绘制-xhdpi,并绘制-tvdpi或绘制,华电国际的的Nexus 7。

put the resources (images or drawable stuff) for Galaxy S3 into drawable-xhdpi, and drawable-tvdpi or drawable-hdpi for Nexus 7.

希望它可以帮助你,请让我知道如果您有任何其他问题:)

Hope it could help you, and please let me know if you have any other problems :)

下面是一些有用的参考资料:

Here are some useful references:

What布局是适合720x1280 Android设备?

Screen宽度预选赛

这篇关于如何创建不同布局的Galaxy S3和Nexus 7?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 11:48