Le fichier de disposition ci-dessous devrait vous donner l'idée que je veux que le contenu de la vue défilante dans le RelativeLayout sous le TextView, mais le contenu du ScrollView sorte du RelativeLayout pour se cacher derrière le TextView. Je ne comprends pas comment cela se passe. Dans le RelativeLayout dans le ScrollView, j'ajoute un objet LinearLayoutCompat par programmation et à cet objet j'ajoute aussi plusieurs objets AppCompatTextView aussi par programmation. La capture d'écran est juste 1 instance de la mise en page.Contenu de ScrollView qui fuit la vue parent dans Android
Je mets le RelativeLayout imbriqué pour démarrer en dessous de TextView mais il commence tout de même par le début.
layout.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/narrowTextnon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@color/cherryRed"
android:elevation="8dp"
android:gravity="center"
android:layout_marginTop="15dp"
android:padding="25dp"
android:text="Let's narrow down now !"
android:textColor="@color/wineBrown"
android:textSize="22sp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/narrowTextnon"
android:gravity="center">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/dataContnon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center">
</RelativeLayout>
</ScrollView>
</RelativeLayout>
</RelativeLayout>
J'ai essayé ceci. S'il vous plaît voir la mise à jour – iammrmehul
Eh bien, vous pouvez combiner ma réponse wit @Robert K. réponse et vous finirez par changer la mise en page racine à «RelativeLayout», en définissant «android: layout_below =" @ id/narrowText "' et en modifiant la hauteur RelativeLayout imbriquée à wrap_content – Tuby
Je vais revenir en arrière quelques étapes, mais cette fois-ci inclure les deux solutions de modification de la mise en page racine à «RelativeLayout» ainsi que la configuration à android: layout_below = "@ id/narrowText". Je vais garder une capture d'écran de ce que j'ai maintenant. – iammrmehul