Я действительно разочарованы с макетом, как показано ниже:Android Layout с ListView
Я хотел бы иметь ListView и ниже, что мне нужно иметь две кнопки бок о бок, как показано выше (LIstview должен быть прокручиваемым, а кнопки должны быть в нижней панели, т. Е. ... в списке списка). Я пробовал использовать android:layout_above
и android:layout_below
, но ничего не получилось. Кто-нибудь может подумать о том, как достичь этого макета?
Это то, что мой код макета сейчас на самом деле у меня есть этот код, где я могу достичь этого, но я не могу нажать на кнопки здесь.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/secondLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="15dp" >
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/firstLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@id/secondLayout"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#00ffffff"
android:gravity="bottom"
android:orientation="horizontal"
android:padding="15dp" >
<Button
android:id="@+id/btnPrevious"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/redbutton"
android:onClick=""
android:text="Previous"
android:textColor="#ffffff" />
<Button
android:id="@+id/btnNext"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/redbutton"
android:text="Next"
android:textColor="#ffffff" />
</LinearLayout>
он работает на устройстве. даже щелчок работает. какую версию для Android вы используете. Я тестировал 4,4 и 2,3. – rachit