我已经使用相对布局为hdpi密度创建了正常屏幕尺寸的布局。但我知道一些屏幕尺寸相同的设备,其底部被裁剪为7-8毫米,用于3个android常用按钮(家庭等)。Android正常屏幕尺寸在底部修剪
现在我不知道如何创建布局以适应这种类型的设备,因为现在它裁剪我的布局7毫米?
谢谢。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/prime"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#8B008B"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="5dp"
tools:context="com.example.testznanja.MainActivity" >
<RelativeLayout
android:id="@+id/rl"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@drawable/question_layout" >
<TextView
android:id="@+id/questionText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>
<Button
android:id="@+id/beginTest"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_below="@+id/infoPanel"
android:layout_marginTop="25dp"
android:background="@drawable/button_normal"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/beginTest"
android:layout_marginTop="18dp"
android:background="@drawable/button_normal"
android:text="Button" />
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/button2"
android:layout_marginTop="18dp"
android:background="@drawable/button_normal"
android:text="Button" />
<Button
android:id="@+id/button4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/button3"
android:layout_marginTop="18dp"
android:background="@drawable/button_normal"
android:text="Button" />
<RelativeLayout
android:id="@+id/infoPanel"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_below="@+id/rl"
android:layout_marginTop="25dp"
android:background="@drawable/info_panel_layout"
android:paddingLeft="5dp"
android:paddingRight="5dp" >
<TextView
android:id="@+id/questionsAnswers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Skor: 0"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="right"
android:text="Vreme: 20"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="50:50"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>
你可以发布你的XML代码,以便我们可以看到问题吗? – chjarder 2014-09-01 02:05:31
我发布.xml文件 – 2014-09-01 12:23:25