2016-06-21 17 views
0

Meine ScrollView funktioniert nicht richtig Ich kann nicht die gesamte Ansicht scrollen Ich habe versucht, Gewichte hinzuzufügen und zu entfernen, aber es funktioniert nicht Kann mir jemand sagen, was mache ich falsch? Unten ist mein XML-Code.ScrollView funktioniert nicht richtig

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    > 

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


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


     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="0.5" 
      android:background="@android:color/darker_gray" 
      android:orientation="vertical"> 

      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center" 
       android:layout_marginTop="20dp" 
       android:src="@drawable/referfriend_screen" /> 

      <TextView 
       android:id="@+id/refersharemessage" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="20dp" 
       android:layout_marginRight="20dp" 
       android:layout_marginTop="5dp" 
       android:padding="0dp" 
       android:text="Share your referal code with a friend and earn Rs. 150/- for every share that translate to a sale" /> 


      <TextView 
       android:id="@+id/yourcode" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="bottom|center" 
       android:layout_marginBottom="25dp" 
       android:text="Your Code" /> 


     </LinearLayout> 


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


      <LinearLayout 
       android:id="@+id/sharecodeWhatsapp" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="10dp" 
       android:layout_marginRight="10dp" 
       android:layout_marginTop="30dp" 
       android:background="@drawable/draw_login_edit_text" 
       android:orientation="horizontal" 
       android:padding="10dp" 
       > 

       <ImageView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:layout_weight="0.5" 
        android:src="@drawable/whatsapp" /> 

       <TextView 
        android:id="@+id/sharecodeWhatsapptext" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:layout_weight="0.5" 
        android:text="Whatsapp Invite" /> 

      </LinearLayout> 

      <LinearLayout 
       android:id="@+id/shareCodeFacebook" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="10dp" 
       android:layout_marginRight="10dp" 
       android:layout_marginTop="10dp" 
       android:background="@drawable/draw_login_edit_text" 
       android:orientation="horizontal" 
       android:padding="10dp" 
       > 

       <ImageView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:layout_weight="0.5" 
        android:src="@drawable/fb_icon" /> 

       <TextView 
        android:id="@+id/sharecodefacebooktext" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:layout_weight="0.5" 
        android:text="Facebook Invite" /> 

      </LinearLayout> 

      <LinearLayout 
       android:id="@+id/shareCodeMore" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="10dp" 
       android:layout_marginRight="10dp" 
       android:layout_marginTop="10dp" 
       android:layout_marginBottom="10dp" 
       android:background="@drawable/draw_login_edit_text" 
       android:orientation="horizontal" 
       android:padding="10dp" 
       > 

       <ImageView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_weight="0.5" 
        android:src="@drawable/more_icon" /> 

       <TextView 
        android:id="@+id/sharecodemoretext" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:layout_weight="0.5" 
        android:text="More Apps  " /> 

      </LinearLayout> 


     </LinearLayout> 


    </LinearLayout> 

    <Button 

     android:id="@+id/referCode" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:background="@drawable/item_view_add_to_cart_click" 
     android:text="YTH45T" 
     android:textColor="@color/white_bg" /> 


</RelativeLayout> 


    </LinearLayout> 
    </ScrollView> 
+0

was ist los ??? –

+0

Ich bin nicht in der Lage, meine ganze Ansicht zu scrollen – stackover65

Antwort

0

die Sie interessieren ..

<?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"> 

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

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


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

       <LinearLayout 
        android:id="@+id/ll" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:orientation="vertical" 
        android:weightSum="1"> 


        <LinearLayout 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:layout_weight="0.5" 
         android:background="@android:color/darker_gray" 
         android:orientation="vertical"> 

         <ImageView 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_gravity="center" 
          android:layout_marginTop="20dp" 
          android:src="@drawable/referfriend_screen" /> 

         <TextView 
          android:id="@+id/refersharemessage" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_marginLeft="20dp" 
          android:layout_marginRight="20dp" 
          android:layout_marginTop="5dp" 
          android:padding="0dp" 
          android:text="Share your referal code with a friend and earn Rs. 150/- for every share that translate to a sale" /> 


         <TextView 
          android:id="@+id/yourcode" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_gravity="bottom|center" 
          android:layout_marginBottom="25dp" 
          android:text="Your Code" /> 


        </LinearLayout> 


        <LinearLayout 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:gravity="center" 

         android:orientation="vertical"> 


         <LinearLayout 
          android:id="@+id/sharecodeWhatsapp" 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content" 
          android:layout_marginLeft="10dp" 
          android:layout_marginRight="10dp" 
          android:layout_marginTop="30dp" 
          android:background="@drawable/draw_login_edit_text" 
          android:gravity="center" 
          android:orientation="horizontal" 
          android:padding="10dp"> 

          <ImageView 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:layout_gravity="center" 

           android:src="@drawable/whatsapp" /> 

          <TextView 
           android:id="@+id/sharecodeWhatsapptext" 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:layout_gravity="center" 

           android:text="Whatsapp Invite" /> 

         </LinearLayout> 

         <LinearLayout 
          android:id="@+id/shareCodeFacebook" 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content" 
          android:layout_marginLeft="10dp" 
          android:layout_marginRight="10dp" 
          android:layout_marginTop="10dp" 
          android:background="@drawable/draw_login_edit_text" 
          android:gravity="center" 
          android:orientation="horizontal" 
          android:padding="10dp"> 

          <ImageView 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:layout_gravity="center" 

           android:src="@drawable/fb_icon" /> 

          <TextView 
           android:id="@+id/sharecodefacebooktext" 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:layout_gravity="center" 

           android:text="Facebook Invite" /> 

         </LinearLayout> 

         <LinearLayout 
          android:id="@+id/shareCodeMore" 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content" 
          android:layout_marginBottom="10dp" 
          android:layout_marginLeft="10dp" 
          android:layout_marginRight="10dp" 
          android:layout_marginTop="10dp" 
          android:background="@drawable/draw_login_edit_text" 
          android:orientation="horizontal" 
          android:padding="10dp"> 

          <ImageView 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:layout_weight="0.5" 
           android:src="@drawable/more_icon" /> 

          <TextView 
           android:id="@+id/sharecodemoretext" 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:layout_gravity="center" 
           android:layout_weight="0.5" 
           android:text="More Apps  " /> 

         </LinearLayout> 


        </LinearLayout> 


       </LinearLayout> 

       <Button 

        android:id="@+id/referCode" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_below="@+id/ll" 
        android:layout_centerInParent="true" 
        android:background="@drawable/item_view_add_to_cart_click" 
        android:text="YTH45T" 
        android:textColor="@color/white_bg" /> 


      </RelativeLayout> 


     </LinearLayout> 
    </ScrollView> 
</RelativeLayout> 
+0

Nein .... funktioniert nicht .... – stackover65

+0

Ich überprüfe es, es funktioniert ... Wenn Ihr Gerät scrollen muss als scroll work ..... (Mean if Gerät enthält alle Inhalte in der ersten Ansicht als Scrollen nicht funktionieren, sonst ist es Arbeit) –

0

Linearlayout entfernen und Relative Layout direkt Kind Scroll machen und es wird Scrollen starten.