Имам малък проблем с дефинирането на относително оформление. Имам изглед на списък с превъртане и два бутона, винаги видими в долната част на изгледа на списък. Просто бих искал двата ми бутона да имат 50% от ширината, запълвайки линията. Това е моят код:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Button
android:id="@+id/testbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="Save" />
<Button
android:id="@+id/cancelButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/testbutton"
android:text="Cancel"/>
<ListView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/LstPeriodOptions"
android:layout_alignParentTop="true"
android:layout_above="@id/testbutton" />
</RelativeLayout>
Опитах се да въведа бутоните в линейно оформление и да дам гравитация=1 с ширина=0dp, но в този случай ListView изчезва. Бихте ли ми помогнали?
Съжалявам за моя английски. Това е резултатът, който бих искал да имам:
Благодаря много, най-добри пожелания.
РЕДАКТИРАНЕ: Това е, което опитах с линейно оформление:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/container" >
<Button
android:id="@+id/testbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="Guardar" />
<Button
android:id="@+id/cancelButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/testbutton"
android:text="Cancelar"/>
</LinearLayout>
<ListView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/LstPeriodOptions"
android:layout_alignParentTop="true"
android:layout_above="@id/container" />
</RelativeLayout>
LinearLayout
? Това трябваше да проработи. - person codeMagic   schedule 02.10.2013