2016-07-12 15 views
0

Ich möchte eine Seite mit mehreren Texten und Bildern erstellen. , aber wenn ich sie in die Bildlaufansicht lege, sagt "ScrollView kann nur ein Kind-Widget haben. Wenn Sie mehr Kinder wollen, wickeln Sie sie in ein Container-Layout." Ich verstehe nicht gut, was ich tun soll.Scroll View mit multi Kind

Antwort

2

Sie mögen dies tun können, als ein Scroll nur eine direkte Kind haben kann, müssen Sie eine Viewgroup wie Linearlayout setzen, relativelayout usw.

<ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:orientation="vertical"> 

      <ProgressBar 
       android:id="@+id/progressBar" 
       android:layout_width="50dp" 
       android:layout_height="50dp" 
       android:layout_gravity="center" /> 

      <TextView 
       android:id="@+id/textViewNoInternet" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center" 
       android:text="@string/check_your_internet_connection" 
       android:textColor="@color/black_transparent_60" 
       android:textSize="16dp" /> 
     </LinearLayout> 

    </ScrollView>