我试图写应用程序女巫将看起来类似的所有(或大多数)Android手机。我有两个手机的问题:三星Galaxy Ace 2和三星Galaxy mini 2.银河王牌需要整个屏幕的布局对于银河迷你来说太大了。如何区分两个不同的android mdpi电话
首先,我试图为ldpi和mdpi指定不同的维度,但似乎两个手机都使用了mdpi值。然后我试图通过屏幕大小来区分它们,并将文件夹值设置为normal-mdpi。我认为王牌应该是“大”,它具有480x800的分辨率,应该是大的文件:Supporting Multiple Screens。 但是,两部手机都从“normal-mdpi”文件夹获取值。另一方面,我看到两个手机上的应用程序看起来完全相同,我该怎么做?
编辑:
想象我有一个非常简单的布局只用简单的观点:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/button6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" /></LinearLayout>
最后一个按钮是不是在较小的手机可见。如果我想让这两个看起来完全相同,我该怎么办?
你的xml看起来像什么 – tyczj
你应该把所有的东西都包含在scrollview中,那么无论多大的屏幕是 – tyczj