5

我开发了在 Google play 上发布的移动应用程序。现在客户端要求应用程序与平板设备兼容。我知道所有不同的可绘制文件夹都用于不同密度的设备。

我从 Tablet Designs 开始,并通过使用另一个名为 layout-large 的布局文件夹来完成所有这些。

现在我的问题是我是否需要分别为 7"、9" 和 10" 屏幕设计平板电脑屏幕?或者对于任何平板电脑设备,保存在 layout-large 文件夹中的屏幕设计将用于平板电脑。

我不确定上面的事情,我什至用 layout-sw720dp 命名了另一个文件夹,并为 9" 平板电脑做了指定。这里我使用了一些不同的图像,因为我们有更多空间。因为我只有 7" 平板电脑要测试它并在测试时看到所有从布局大文件夹中使用的屏幕都很好。当我将我的 apk 文件发送给客户端时,已知客户端也只能看到布局大文件夹屏幕。

我对此进行了很多搜索,我发现只有单独的布局,但我没有发现任何关于设计适用于所有平板电脑或单独的屏幕的信息。阅读 android 教程,我发现我们应该使用说明符 sw600dp、sw720dp。这意味着两者都应该在那里,或者任何一个都不够理解。

我对我的英语感到非常抱歉,这是我第一次做移动应用程序的平板电脑兼容性。请在这方面提供帮助。

提前致谢。

4

2 回答 2

2

Should I need to design the Tablet Screen separately for 7",9" and 10" screens?

Hopefully not, but that is impossible to answer in the abstract.

or for any tablet device the screen designs saved in layout-large folder will be used for tablets.

Yes. If you do not provide a res/layout-xlarge/ directory, -xlarge devices (e.g., 10" tablets) will use res/layout-large/.

Reading android tutorial, i found we should use specifiers sw600dp, sw720dp. this mean both should be there or any one enough is not understood

You are welcome to use those if you wish. Note that they only work on Android 3.2 and higher.

于 2012-11-03T20:06:15.193 回答
0

该解决方案也适用于所有 android 手机设备和平板电脑。这是相同的解决方案

public String getScreenResolution()
    {
    int screenSize = getResources().getConfiguration().screenLayout &
    Configuration.SCREENLAYOUT_SIZE_MASK;
     switch(screenSize) {
    case Configuration.SCREENLAYOUT_SIZE_XLARGE:
    deviceResolutionString="tablet";
    // This will returns tablet , you can start your tablet activity from here 
     break;
    case Configuration.SCREENLAYOUT_SIZE_LARGE:
    deviceResolutionString="tablet";
    // This will returns tablet , you can start your tablet activity from here 
    break;
    case Configuration.SCREENLAYOUT_SIZE_NORMAL:
    deviceResolutionString="device";
    // This will returns Phone , you can start your phone activity from here 
    break;
    case Configuration.SCREENLAYOUT_SIZE_SMALL:
    deviceResolutionString="device";

    // This will returns Phone , you can start your phone activity from here 
    break;
    default:
    }
    returndeviceResolutionString;
    }
于 2013-03-20T11:24:56.393 回答