У меня проблемы с RelativeLayout. Я хочу показать кнопку в нижней части экрана «Макет», но она не отображается.RelativeLayout в Android: Виджет не отображается
Смотрите изображение ниже:
http://i.imgur.com/70XxIka.png
Мой XML:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SABORES EXISTENTES"
android:id="@+id/textViewNovoSabor"
android:textAlignment="center"
android:textColor="#0501e5" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
tools:context=".MainActivity"
android:id="@+id/rowsContainerControleSabor"
android:layout_below="@+id/textViewNovoSabor"
style="@android:style/Widget.Holo.Light.EditText">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/listView" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="vertical"
android:layout_below="@id/rowsContainerControleSabor">
<Button
android:id="@+id/btnAddNewItem"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/transparent_background"
android:paddingLeft="5dp"
android:text="Adicionar sabor"
android:textColor="@android:color/darker_gray"
android:height="20dp"
android:layout_below="@+id/rowsContainerControleSabor"
/>
</LinearLayout>
</RelativeLayout>
Я перепробовал все варианты я знаю .. Я использовал андроида: layout_below установить положение, теперь его скрытый.
Я попробовал этот способ, но он дал мне ошибку: ресурс не может быть найден: «@idmyButton», поэтому я снял первый LinearLayout и поставил «layout_above с @idMyButton» прямой в ListView, и это сработало. –