Bonjour j'essaie d'ajouter scrollview à ma mise en page mais il me donne erreur scrollview peut accueillir un seul enfant direct. Je veux faire défiler seulement edittext pas un imageviev et bouton bouton les deux doivent être constantes. Et quand je fais la rotation de mon appareil au paysage contient ne sont pas des affichages. s'il vous plaît donner la solution pour cetteScrollview donne une erreur dans android
Voici mon code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#aeabab"
android:orientation="vertical"
android:weightSum="1">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbarforprofile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
android:minHeight="?attr/actionBarSize"
android:titleTextColor="#000"
app:theme="@style/ToolbarColoredBackArrow" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:background="@mipmap/icon_car" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="CAR PREFERENCE"
android:textColor="#111"
android:textSize="17dp" />
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="5dp"
android:background="#ffffff"
android:orientation="vertical">
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:drawableLeft="@mipmap/icon_location"
android:drawablePadding="10dp"
android:hint="WHERE TO GO" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:paddingLeft="5dp"
android:text="FROM DATE"
android:textColor="#111"
android:textSize="17dp" />
<EditText
android:id="@+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:drawableLeft="@mipmap/icon_calendar"
android:drawablePadding="10dp"
android:hint="30/05/2017" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:paddingLeft="5dp"
android:text="TO DATE"
android:textColor="#111"
android:textSize="17dp" />
<EditText
android:id="@+id/editText3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:drawableLeft="@mipmap/icon_calendar"
android:drawablePadding="5dp"
android:hint="30/05/2017" />
<EditText
android:id="@+id/editText4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:drawableLeft="@mipmap/icon_clock"
android:drawablePadding="5dp"
android:hint="10 AM" />
<EditText
android:id="@+id/editText5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:drawableLeft="@mipmap/icon_people"
android:drawablePadding="5dp"
android:hint="NUMBER OF PERSON"
android:inputType="number"
android:maxLines="1" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:paddingLeft="8dp"
android:text="CAR TYPE"
android:textColor="#111"
android:textSize="17dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="@+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="SEDDAN" />
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="HACHBACK" />
<RadioButton
android:id="@+id/radioButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SUV" />
</RadioGroup>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:layout_marginTop="-57dp"
android:gravity="center"
android:scaleX="0.9"
android:scaleY="0.9">
<Button
android:id="@+id/btn_submit"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_gravity="center"
android:background="@drawable/rounded_green"
android:ems="10"
android:gravity="center"
android:text="ORDER NOW"
android:textSize="20dp"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
Si vous voulez simplement faire défiler l'EditText, mettez sa hauteur à wrap_content et il va automatiquement faire défiler et enlever le parchemin. Voir –