Re: Урок 6. Виды Layouts. Ключевые отличия и свойства.
Добавлено: 28 дек 2012, 20:14
Люди, пытаюсь сделать экранчик, где вверху текст, внизу текст, а посередине - listview. Сделала relativelayout, затем каждому компоненту сказала под каким он должен находиться с помощью свойства below, нижнему тексту определила выравнивание по низу экрана. Но как только делаю среднему компоненту fillparent - то нижнего мне уже не видать.
Вот этот xml
не смотрите, что у меня компоненты обернуты в layout-s, просто экранчик чуть сложнее в реальности.
Прошу помощи!
Вот этот xml
Код: Выделить всё
<?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:layout_weight="1.0"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/layoutTop"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_weight="0.0"
android:orientation="vertical" >
<TextView
android:id="@+id/tvText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginBottom="1.0dip"
android:layout_marginLeft="1.0dip"
android:layout_marginRight="1.0dip"
android:layout_marginTop="1.0dip"
android:gravity="center_horizontal"
android:paddingLeft="10dp"
android:text="ТЕКСТ ВВЕРХУ"
android:textSize="14dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/layoutListview"
android:layout_width="fill_parent"
android:layout_height="150dp"
android:layout_below="@id/layoutTop" >
<ListView
android:id="@+id/lv"
android:layout_width="fill_parent"
android:layout_height="204dp" />
</LinearLayout>
<RelativeLayout
android:id="@+id/layoutBottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:gravity="bottom"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<TextView
android:id="@+id/tvText2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:paddingRight="5dp"
android:text="ТЕКСТ ВНИЗУ"
android:textAllCaps="true"
android:textSize="14dp" />
</RelativeLayout>
</RelativeLayout>
Прошу помощи!