本文介绍了Android的布局设计原则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做了很多的研究,设计布局不同的屏幕尺寸,屏幕像素密度和方向的最佳方式和我越来越糊涂了。

I have been doing a lot of research on the best ways to design layouts for different screen sizes, screen density and orientations and I am getting increasingly confused.

1。设计密度VS屏幕尺寸
  我已阅读本link

1. Design Density vs Screen Size
I have read this link

设计为姜饼什么时,应考虑现在。每个文件夹中的布局说 LDPI,华电国际和MDPI 。但是,这增加了整个应用程序的大小。

Now when designing for gingerbread what should be considered. Layouts in each folder say LDPI, HDPI and MDPI. But that increases the size of the entire application.

现在我已经不再考虑LDPI。但是,现在我们也有 XHDPI和XXHDPI 。那么,我们如何去设计的所有网页,但保持一定的尺寸是否合理?

Now i have stopped considering for LDPI. But now we also have XHDPI and XXHDPI.So how do we go about designing for all pages and yet keep the size reasonable?

什么应该被赋予更多的preference屏幕尺寸,密度或分辨率?

And what should be given more preference screen size, density or resolution?

有关图像 9补丁图像可以使用。 什么是创建它们的最佳工具?

FOr images 9-patch images can be used . What is the best tool to create them?

2.Landscape VS Potrait。

现在这个布局公式,如果我们有不同的布局屏幕方向,应用程序变得笨重和繁琐的工作。

Now in this layout equation if we include different layouts for screen orientation, the application becomes bulkier and the work tedious.

创建更小的XML,并包括他们一个很好的解决方案但即使如此,考虑到各种不同类型的它仍然变得乏味。专为安卓4.0及以上具有不同布局中的每个片段,

Creating smaller xmls and including them is one good solution but even then ,considering all the different types it still becomes tedious. Specially for Android 4 and above with each fragment having a different layout,

我的问题is--什么是设计布局考虑上述所有的最好和最有效的方式。

My question is-- what is the best and most efficient way to design layouts considering all the above.

推荐答案

Play商店,您可以用不同的硬件发布多个APK瞄准设备。您的目标设备属性指定在每个不同的APK的清单。对于不同的屏幕密度,您可以使用<兼容屏> 元素。例如,针对小型设备用 LDPI 分辨率的应用程序将包括:

The Play Store allows you to publish multiple APKs' targeting devices with different hardware. The device property that you are targeting is specified in the manifest of each different APK. For different screen densities, you use the <compatible-screens> element. For instance, an application targeting small-sized devices with ldpi resolution would include:

<compatible-screens>

    <screen android:screenSize="small" android:screenDensity="ldpi" />

</compatible-screens>

在这种方式中,您编译和放大器;构建不同的APK为针对不同的设备相同的应用程序,你有不同大小的图像,你的 RES /绘制目录取决于设备的分辨率,每个人APK是针对。不同的APK可以在同一个应用程序标题下被公布在Play商店,将自动被Play商店服务APK基于该设备的硬件过滤(即每Android设备上的Play商店应用present)。

In this way, you compile & build different APKs' for the same application targeting different devices, and you include different-sized images in your res/drawable directory depending on the device resolution that each individual APK is aimed at. The different APKs' can be published on the Play Store under the same application heading and will be automatically filtered by the Play Store Services APK (i.e. the Play Store app present on every Android device) based on that device's hardware.

参考文献:

1 多APK支持

2 分配给特定的屏幕

3。 过滤器播放

这篇关于Android的布局设计原则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 00:28