android scrollview hauteur

j'ai eu de problème pour faire la scrollview envelopper le contenu.
je ne sais pas pourquoi, mais les scrollview hauteur est plus grande que le contenu que je suis
j'ai lu sur certains moyen de le réparer, mais aucun d'entre eux m'aider (layout_weight , fill_parents , warp_content,android:fillViewport="true").
donc je suppose que j'ai une simple erreur dans mon code,
mon code est:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/title_bg"
android:gravity="center"
android:text="Profile"
android:textColor="#fff"
android:textSize="20sp" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true" >
<LinearLayout
android:id="@+id/LinearLayout01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/background"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="@string/mother"
android:textAppearance="? android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/etMother"
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
android:layout_weight="1"
android:ems="10"
android:hint="@string/enter_your_name"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ToggleButton
android:id="@+id/tbDueDateLMP"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@drawable/button_red"
android:checked="true"
android:textColor="#fff"
android:textOff="@string/due_date"
android:textOn="@string/lmp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/bPlusDay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:background="@drawable/button_blue"
android:onClick="onClick"
android:text="@string/plus"
android:textColor="#fff"
android:textSize="20sp"
android:textStyle="bold" />
<Button
android:id="@+id/bPlusMonth"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:background="@drawable/button_blue"
android:onClick="onClick"
android:text="@string/plus"
android:textColor="#fff"
android:textSize="20sp"
android:textStyle="bold" />
<Button
android:id="@+id/bPlusYear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_weight="0.69"
android:background="@drawable/button_blue"
android:onClick="onClick"
android:text="@string/plus"
android:textColor="#fff"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/tvDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:background="@drawable/black_back"
android:padding="3dp"
android:text="00"
android:textColor="#000"
android:textSize="59sp" />
<TextView
android:id="@+id/tvMonth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:background="@drawable/black_back"
android:padding="3dp"
android:text="00"
android:textColor="#000"
android:textSize="59sp" />
<TextView
android:id="@+id/tvYear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_weight="0.69"
android:background="@drawable/black_back"
android:padding="3dp"
android:text="0000"
android:textColor="#000"
android:textSize="59sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/bMinusDay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="4dp"
android:layout_weight="1"
android:background="@drawable/button_blue"
android:onClick="onClick"
android:text="@string/minus"
android:textColor="#fff"
android:textSize="20sp"
android:textStyle="bold" />
<Button
android:id="@+id/bMinusMonth"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="4dp"
android:layout_weight="1"
android:background="@drawable/button_blue"
android:onClick="onClick"
android:text="@string/minus"
android:textColor="#fff"
android:textSize="20sp"
android:textStyle="bold" />
<Button
android:id="@+id/bMinusYear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="4dp"
android:layout_weight="0.69"
android:background="@drawable/button_blue"
android:onClick="onClick"
android:text="@string/minus"
android:textColor="#fff"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
<Button
android:id="@+id/bProfileSave"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="@drawable/button_pink"
android:onClick="onClick"
android:text="@string/save"
android:textColor="#fff" />
<TextView
android:id="@+id/tvProfileInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#F00" />
</LinearLayout>
</ScrollView>
</LinearLayout>

merci à vous tous.

  • Vous devez fournir android:layout_width="fill_parent" pour un défilement d'affichage. alors seulement il va afficher le contenu.
  • salut Rajesh et merci pour la réponse rapide. je l'ai essayer mais cela ne fonctionne pas pour moi :[
  • k k. de remplissage ensemble des parents à la racine de la mise en page de la hauteur et de la largeur.. puis appliquer remplir parent pour faire défiler la vue . qui va travailler
  • 10x beaucoup m8-il aider :]
InformationsquelleAutor Blackstar | 2013-01-03