Я довольно новичок в разработке Android.
Я использую следующий RelativeLayout.
Я хочу, чтобы мой txtView1 был выше lstAnswers, но layout_below не работает, и представления накладываются.Layout_below не работает в RelativeLayout
<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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:background="#ffbad6e6"
tools:context="com.example.user.myApp.QuestionDetails">
<TextView
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/txtView1"
android:textColor="#ff0d5e52"/>
<ListView
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:id="@+id/lstAnswers"
android:layout_centerHorizontal="false"
android:paddingTop="50dp"
android:layout_alignParentTop="true"
android:divider="@android:color/transparent"
android:dividerHeight="10dp"
android:layout_below="@id/txtView1"/>
</RelativeLayout>
Я также попытался установить layout_below с помощью @ + идентификатор, например:
android:layout_below="@+id/txtView1"
но не дал мне ничего.
Может ли кто-нибудь объяснить мне, как установить txtView1 над lstAnswers?
Всё. Спасибо! – Gleb
@ Gleb Вы можете принять этот ответ. –