2016-12-23 2 views
1
<LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    android:id="@+id/linearLayoutUser" 
    > 

<!-- TODO: Update blank fragment layout --> 

<ExpandableListView 
    android:id="@+id/expandableListView" 

    android:layout_width="match_parent" 
    android:layout_alignParentTop="true" 
    android:groupIndicator="@null" 
    android:layout_gravity="left|top" 
    android:layout_weight="1" 



    /> 

// nur über Code ist sichtbar // Unterhalb dieser Code // unten nicht sichtbar ist Details Informationen in Scrollview istLayout unterhalb der erweiterbaren Ansicht ist nicht sichtbar?

<ScrollView 

     android:layout_width="match_parent" 


     android:layout_gravity="center" 
     android:layout_weight="1" 
     > 
    </scrollView> 

</LinearLayout> 

Antwort

2

Setzen Sie die richtigen android:layout_weight und android:layout_height Wert.

<LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" 
     android:id="@+id/linearLayoutUser"> 

      <ExpandableListView 
      android:id="@+id/expandableListView" 
      android:layout_height="0dp" 
      android:layout_width="match_parent" 
      android:layout_alignParentTop="true" 
      android:groupIndicator="@null" 
      android:layout_gravity="left|top" 
      android:layout_weight="1"/>  

     <ScrollView 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_gravity="center" 
      android:layout_weight="1" 
      android:fillViewport="true"> 
     // your work 
    </ScrollView> 
</LinearLayout> 
+0

nicht funktioniert .... –

+0

Dank bt noch nicht funktioniert .. –

0

ändern xml:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/linearLayoutUser" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

    <ExpandableListView 
     android:id="@+id/expandableListView" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_gravity="left|top" 
     android:layout_weight="1" 
     android:groupIndicator="@null" /> 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:fillViewport="true"> 

     <!--Scroll view with only one direct child--> 

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

      <!--Do your work here--> 

     </LinearLayout> 
    </ScrollView> 

</LinearLayout> 
+0

Nein .... Aber danke !!! –

0

Es gibt zwei Eigenschaften, die für das Gewicht verwendet wird. 1) layout_weight
2) weightsum

In einem Container/Eltern (a lineaLayout) Sie sollten eine layout_weightsum eingestellt, die die Gesamtmenge des Gewichts ist, dass Sie in diesem Layout verwenden.

Hier haben Sie lineare Layout mit zwei Elementen, und beide Elemente müssen die gleiche Höhe haben.

Sie werden eine Summe von 2 und für jedes Layout ein Gewicht von 1 für jedes Kind-Layout festlegen.

Hoffe, es wird helfen!

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/linearLayoutUser" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:weightSum="2"> 

    <ExpandableListView 
     android:id="@+id/expandableListView" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_gravity="left|top" 
     android:layout_weight="1" 
     android:groupIndicator="@null" /> 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:fillViewport="true" 
     android:layout_weight="1"> 

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

      <!--Add your other part which you want to show in ScrollView--> 

     </LinearLayout> 
    </ScrollView> 
</LinearLayout> 
Verwandte Themen