2013-02-28 10 views
28

पर स्क्रॉल नहीं करता है मुझे अपनी गतिविधि में एक निश्चित समस्या है। स्क्रॉलव्यू नीचे तक स्क्रॉल नहीं करता है।
मेरे पास आपके लिए एक स्क्रीनशॉट है। enter image description hereस्क्रॉलव्यू नीचे

यदि आप scrollView की स्क्रॉलबार देखते हैं, तो आप देख सकते हैं कि यह नीचे तक स्क्रॉल नहीं कर रहा है।

<ScrollView 
    android:id="@+id/scrollView1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentRight="true" 
    android:fillViewport="true" 
    android:layout_below="@+id/step2_header" > 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_margin="10dp" > 

     <TextView 
      android:id="@+id/step2_headerText" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentTop="true" 
      android:layout_alignParentRight="true" 
      android:gravity="center" 
      android:text="@string/Schritt2" 
      android:textAppearance="?android:attr/textAppearanceMedium" 
      android:textColor="@color/dark_blue" 
      android:textStyle="bold|italic" /> 

     <ImageView 
      android:id="@+id/step2_image" 
      android:layout_width="wrap_content" 
      android:layout_height="100dp" 
      android:layout_below="@+id/step2_headerText" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentRight="true" 
      android:layout_marginTop="10dp" 
      android:src="@drawable/menu_leiste" /> 

     <TextView 
      android:id="@+id/step2_infoText" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="10dp" 
      android:layout_alignParentLeft="true" 
      android:layout_below="@+id/step2_image" 
      android:text="@string/step2Text" 
      android:textAppearance="?android:attr/textAppearanceSmall" /> 

     <ImageView 
      android:id="@+id/step2_but1Img" 
      android:layout_width="match_parent" 
      android:layout_height="35dp" 
      android:layout_below="@+id/step2_infoText" 
      android:layout_marginTop="10dp" 
      android:src="@drawable/menu_leiste_selector" /> 

     <TextView 
      android:id="@+id/step2_but1Text" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignBottom="@+id/step2_but1Img" 
      android:layout_alignParentLeft="true" 
      android:layout_alignTop="@+id/step2_but1Img" 
      android:layout_marginLeft="10dp" 
      android:gravity="center" 
      android:text="@string/step2But1Text" 
      android:textAppearance="?android:attr/textAppearanceMedium" 
      android:textColor="@color/white" /> 

     <ImageView 
      android:id="@+id/step2_but1ArrowImg" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_margin="3dp" 
      android:layout_alignBottom="@+id/step2_but1Img" 
      android:layout_alignParentRight="true" 
      android:layout_alignTop="@+id/step2_but1Img" 
      android:src="@drawable/location_web_site" /> 

     <ImageView 
      android:id="@+id/step2_but2Img" 
      android:layout_width="match_parent" 
      android:layout_height="35dp" 
      android:layout_below="@+id/step2_but1Img" 
      android:layout_marginTop="10dp" 
      android:src="@drawable/menu_leiste_selector" /> 

     <TextView 
      android:id="@+id/step2_but2Text" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignBottom="@+id/step2_but2Img" 
      android:layout_alignParentLeft="true" 
      android:layout_alignTop="@+id/step2_but2Img" 
      android:layout_marginLeft="10dp" 
      android:gravity="center" 
      android:text="@string/step2But2Text" 
      android:textAppearance="?android:attr/textAppearanceMedium" 
      android:textColor="@color/white" /> 

     <ImageView 
      android:id="@+id/step2_but2ArrowImg" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_margin="3dp" 
      android:layout_alignBottom="@+id/step2_but2Img" 
      android:layout_alignParentRight="true" 
      android:layout_alignTop="@+id/step2_but2Img" 
      android:src="@drawable/location_web_site" /> 

    </RelativeLayout> 

</ScrollView> 

मैं इसे कैसे ठीक कर सकते हैं:
यहाँ scrollview की मेरी एक्सएमएल लेआउट है?

उत्तर

90
समस्या

एंड्रॉयड है: SrcollView

की RelativeLayout में layout_margin = "10dp" साथ

<RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:padding="10dp" > 
+0

धन्यवाद! इसने मेरी बहुत मदद की! लेआउट_मर्गिन और पैडिंग के बीच –

+4

अंतर यह है कि layout_margin लेआउट के लिए मार्जिन है और पैडिंग लेआउट सामग्री –

+0

के लिए मार्जिन है स्क्रॉलव्यू के साथ कई लोगों को समस्याएं हैं, नीचे स्क्रॉल नहीं कर रहे हैं और विभिन्न मुद्दों को ध्वजांकित किया गया है (सही या गलत तरीके से) लेकिन यह है एकमात्र पोस्टिंग मुझे पता है कि इस विशेष मार्जिन मुद्दे को ध्वजांकित किया गया है। आपने वास्तव में यहां मेरे बेकन को बचाया। SO # 16880311 में मैंने इस बहुत ही मार्जिन मुद्दे और एक संभावित कार्यवाही से टूटे हुए लेआउट का एक पूरा उदाहरण पोस्ट किया; यह कुछ के लिए उपयोगी हो सकता है। संक्षेप में, मुद्दा यह है कि आप एक अतिरिक्त, गद्दीदार कंटेनर के साथ मार्जिन अनुकरण कर सकते हैं। – olefevre

-3

यह आपके लेआउट डिज़ाइन के साथ समस्या हो सकती है। यदि आप दृश्य के लिए मार्जिन जोड़ते हैं तो यह स्पष्ट रूप से दिखाई देगा। इसलिए

scrollview में scrollview एक्सएमएल में जोड़ने

android:layout_marginBottom="30dp" 
+0

काम नहीं किया, माफ करना –

+0

scrollview है

<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="10dp"> 

बदलें अपनी माता पिता? –

+0

नहीं, मेरे स्क्रॉलव्यू में एक relativelayout है। –

3

उपयोग

android:paddingBottom="10dp" 

यह नहीं ऊपर की ओर 10 डीपी देखने के लिए स्क्रॉल देखने की सामग्री शिफ्ट करेंगे।

+0

में काम नहीं किया, क्षमा करें –

+0

स्क्रॉल के नीचे लेआउट में पैडिंग जोड़ना दृश्य देखें। ScrollView में जोड़ना काम नहीं करता है। – Manpreet

संबंधित मुद्दे