У меня проблема с моим приложением, когда расположение кнопок не равномерно распределено при использовании на разных устройствах.Расположение интервалов между кнопками Android неравномерно
Как показано на рисунке, первый снимок экрана показывает разметку, размещенную на более раннем, более мелком экранированном Android-смартфоне.
Второй скриншот с Nexus 4, показывает большое белое пространство под нижней кнопкой, которая является неравномерной.
Я думал, что я установил мой макет быть даже, но кажется, что это не.
UPDATE: Как установить вид прокрутки с двумя линейными макетами в нем.
<?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="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="84dp"
android:orientation="horizontal" >
<ImageView
android:id="@+id/imgLink"
android:layout_width="78dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/appointmentmanimenuicon" />
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="75dp"
android:gravity="center"
android:text="Appointments"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="30sp" />
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:orientation="vertical" >
<Button
android:id="@+id/btnaddAppoint"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="50dp"
android:drawableLeft="@drawable/appointmentmenu"
android:src="@drawable/appointmentmenu"
android:text="Add Appointment"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:orientation="vertical" >
<Button
android:id="@+id/btnviewAppoint"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="50dp"
android:drawableLeft="@drawable/appointviewicon"
android:src="@drawable/appointviewicon"
android:text="View Appointments"
android:layout_weight="1" />
</LinearLayout>
</ScrollView>
</LinearLayout>
Любопытно, что нужно дополнительному 'ScrollView' там? –
android: layout_height = "400dp" вы попробовали сделать match_parent –
Если вы удалили ScrollView и присвоили внешнему LinearLayout весу, что произойдет потом? –