2017-08-11 19 views
10

ध्यान केंद्रित चोरी असल में मैं वर्तमान में एक AndroidTV अनुप्रयोग के लिए काम कर रहा हूँ। मेरे पास NestedScrollView के अंदर उस छवि की तरह कई क्षैतिज RecyclerView दाएं से बाएं हैं।NestedScrollView अंदर एकाधिक क्षैतिज RecyclerView

समस्या यह है कि जब मैं के प्रति अधिक छोड़ दिया स्क्रॉल, तो अलग अलग सूची या अलग दृष्टिकोण है जो अच्छा नहीं है करने के लिए ले जाता है ध्यान केंद्रित है।

मैं फ़ोकस बदलने के लिए नहीं करना चाहती। यदि सूची अंत तक पहुंच जाती है, तो फोकस एक ही स्थिति में रहना चाहिए।

मैंने कोशिश की:

android:descendantFocusability="blocksDescendants" 
android:focusableInTouchMode="true" //in parent layout 

लेकिन यह काम नहीं किया ..

किसी को भी मेरी मदद कर सकते हैं बाहर ??

enter image description here

हल नहीं

+0

इस [संबंधित एसओ पोस्ट] में समाधान का अनुसरण करें (https://stackoverflow.com/a/42688298/5995040) –

+0

पहले से ही करने की कोशिश की लेकिन नहीं उपयोगी @ Mr.Rebot –

+0

मैं एंड्रॉयड उपयोग करने के साथ मेरी समस्या हल: descendantFocusability = स्क्रॉलव्यू में रूट लेआउट के लिए "ब्लॉक डिस्केन्डेंट्स"। स्क्रॉलव्यू के बजाय nestedscrollview का भी उपयोग करना। – asozcan

उत्तर

0

अपने ScrollViewNestedScrollView को बदलने का प्रयास करें। इसके पीछे एक कारण

**NestedScrollView** 

NestedScrollView सिर्फ scrollview की तरह है, लेकिन यह दोनों एक नेस्टेड स्क्रॉल माता पिता और दोनों नए और पुराने संस्करणों एंड्रॉयड के पर बच्चे के रूप में अभिनय समर्थन करता है। नेस्टेड स्क्रॉलिंग डिफ़ॉल्ट रूप से सक्षम है।

**ScrollView** 
कि उपयोगकर्ता द्वारा स्क्रॉल किया जा सकता है, यह शारीरिक प्रदर्शन से भी बड़ा करने के लिए अनुमति के लिए एक दृश्य पदानुक्रम के लिए

लेआउट कंटेनर। एक स्क्रॉल व्यू एक फ़्रेमलाउट है, जिसका अर्थ है कि आपको इसमें एक बच्चा रखना चाहिए जिसमें स्क्रॉल करने के लिए संपूर्ण सामग्री शामिल है; इस बच्चे को खुद वस्तुओं

यह आपको यह निर्धारित करने के लेआउट ध्यान केंद्रित किया जा रहा है में मदद मिलेगी की एक जटिल पदानुक्रम के साथ एक लेआउट प्रबंधक हो सकता है।

+0

पहले से ही मैं सहायक ... @Dipali शाह –

+0

NestedScrollView लेकिन इस्तेमाल नहीं किया सवाल में आप अपने 'मेरे सवाल Recyclerview' अंदर है' ScrollView' –

+0

उस के लिए क्षमा करें, मैं अद्यतन नहीं कर रहा हूँ उल्लेख किया है। –

0

आप नेस्टेड स्क्रॉल

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/white" 
    android:clickable="false" 
    android:orientation="vertical"> 

    <android.support.v4.widget.NestedScrollView 
     android:id="@+id/scroll_search_all" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

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

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

       <android.support.v7.widget.RecyclerView 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:isScrollContainer="false" 
        android:nestedScrollingEnabled="false" /> 

      </LinearLayout> 

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

       <android.support.v7.widget.RecyclerView 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:isScrollContainer="false" 
        android:nestedScrollingEnabled="false" /> 

      </LinearLayout> 
     </LinearLayout> 
    </android.support.v4.widget.NestedScrollView> 
</FrameLayout> 

के लिए संरचना नीचे का उपयोग कर सकते मुझे आशा है कि यह मदद मिलेगी!

+0

क्षमा करें, यह कुछ भी नहीं बदलेगा। आपकी मदद के लिए धन्यवाद .. @ अलपेश सोरथीया –

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