android应用程序的设计问题,适用于三星Note 2和Galaxy S4等少数手机设备
我一直在为Android操作系统开发应用程序。这个应用程序相当完整,但我面临的问题是屏幕大小。有几个设备上的应用程序在正确的设计下正常工作,还有一些设备上的应用程序没有正常工作 应用程序设计在以下方面运行良好: 三星Galaxy Grand(Quattro)-屏幕尺寸5.0“ 三星Galaxy大屏幕-屏幕尺寸5“ 三星Duos 7.62-屏幕尺寸4.0“ HTC One V-屏幕尺寸3.7“ 并且应用程序设计在以下方面无法正常工作: 三星笔记2 三星Galaxy S4 HTC感觉 这些是迄今为止我能够测试的应用程序手机android应用程序的设计问题,适用于三星Note 2和Galaxy S4等少数手机设备,android,Android,我一直在为Android操作系统开发应用程序。这个应用程序相当完整,但我面临的问题是屏幕大小。有几个设备上的应用程序在正确的设计下正常工作,还有一些设备上的应用程序没有正常工作 应用程序设计在以下方面运行良好: 三星Galaxy Grand(Quattro)-屏幕尺寸5.0“ 三星Galaxy大屏幕-屏幕尺寸5“ 三星Duos 7.62-屏幕尺寸4.0“ HTC One V-屏幕尺寸3.7“ 并且应用程序设计在以下方面无法正常工作: 三星笔记2 三星Galaxy S4 HTC感觉 这些是迄今为止
We have different design sizes for:
320 x 480 -- mdpi
480 x 800 -- hdpi
640 x 960 --
720 x 1280 -- xhdpi
1080 x 1920 -- xxhdpi.
应用程序的主屏幕有6行。如下图所示
对于三星note 2和S4,屏幕超过了移动屏幕,就像最后一个标签只显示了一半一样,在HTC Sensation中,标签没有完全填满屏幕,留下1/4的屏幕空白
请帮忙提建议。我需要知道的是,我需要设计一些其他尺寸的屏幕,屏幕大小应该是多少。或者我现在做错了什么
提前感谢,,
泽山这取决于您的布局
让我们考虑水平行是线性布局
使用布局权重属性“1”(布局权重=“1”) 它将所有布局隔开以适合屏幕 请确保应用程序中的徽标为中等大小,以便它们不会超过所需空间。它们也会造成错位希望这有帮助……行的高度对您来说是个问题吗 如果希望所有行都适合屏幕,而不考虑屏幕大小,则可以使用。将每行的高度指定为0dp,然后使用布局重量对其进行称重。如果所有行具有相同的权重,则它们将均匀分布。下面,我给了第三行更高的权重(2而不是1),因为它在您的屏幕截图中看起来更大
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<View android:id="@+id/row_one"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
<View android:id="@+id/row_two"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
<View android:id="@+id/row_three"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="2">
<View android:id="@+id/row_four"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
<View android:id="@+id/row_five"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
<View android:id="@+id/row_six"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
</LinearLayout>
三星Note 2属于xhdpi类别,三星Galaxy S4属于xxhdpi类别,而且这些手机有大屏幕,因此最好为这些手机提供不同的布局
layout-large
layout-xlarge
以及相应的可绘制文件夹
drawable-large
drawable-xlarge
然后,无论何时运行应用程序,android都会根据给定的资源自动分配资源,否则将从默认文件夹中获取一些代码(Mind to post some code?:)