के अंदर SwipeRefreshLayout मेरे पास एक ऐसी गतिविधि है जिसमें टूलबार और व्यू पेजर शामिल है। अपने लेआउट इस प्रकार है:ViewPager
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="112dp"
android:layout_gravity="bottom"
tools:context=".Rhino68PanelActivity" />
<LinearLayout
android:id="@+id/toolbarContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="@+id/app_bar"
layout="@layout/app_bar" />
<include
android:id="@+id/tap_strip"
layout="@layout/tab_strip" />
</LinearLayout>
मैं तो दृश्य पेजर में दो टुकड़े लोड। प्रत्येक खंड में अपना SwipeRefreshLayout
होता है।
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="12"
tools:context=".Rhino68PanelActivity$DummySectionFragment">
...
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_panel_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false" />
</LinearLayout>
अब जब मैं गतिविधि चलाने के यह काम करने लगता है: मैं एक टुकड़े लेआउट दिखाएगा। हालांकि मैंने देखा है कि मैं क्षैतिज रूप से स्लाइड करता हूं (यानी अगले टैब पर जाने के लिए)। यह swipeRefreshLayout
OnRefreshListener
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
mSwipeRefreshLayout.setRefreshing(true);
DoUpdate();
}
});
मैं भी अजीब दृश्य व्यवहार का सामना कर रहा हूँ जब मैं कोशिश करते हैं और एक ताज़ा करते हैं चलाता है। लोडिंग साइन (कताई चक्र) अक्सर प्रदर्शित नहीं होता है, और यह कभी-कभी दिखाता है लेकिन छोटे रहता है। मुझे यकीन नहीं है कि यह एक दूसरे के साथ विवादित दो विचारों का कारण भी है।
क्या कोई तरीका है कि मैं इस समस्या को ठीक कर सकता हूं। मुझे यकीन नहीं है कि कैसे। शायद SwipeRefreshLayout को केवल ऊर्ध्वाधर स्वाइप के लिए सुनने के लिए सीमित करके?
किसी भी सुझाव की सराहना की जाएगी।
मेरे पास मेरे प्रोजेक्ट के अंदर यह समस्या नहीं है, जो एक समान संरचना का भी उपयोग करती है। क्या आप एक नमूना परियोजना पोस्ट कर सकते हैं जो इस मुद्दे को पुन: उत्पन्न करता है? – corsair992
क्या आप अपना लेआउट साझा करना चाहते हैं? निश्चित रूप से दो लेआउट एक दूसरे के साथ हस्तक्षेप करेंगे? अगर मैंने 'स्वाइप रिफ्रेश लयआउट' को भी टेप किया है तो यह 'ऑनरफ्रेश() ' – Zapnologica
ट्रिगर करेगा, इनमें से किसी भी' व्यू ग्रुप 'को स्पर्श ईवेंट पर ले जाने से पहले एक ढलान अंतराल है, और यह निर्धारित करता है कि ड्रैग अधिक लंबवत या क्षैतिज था या नहीं । एक बार टच इवेंट 'व्यू ग्रुप' द्वारा लिया जाता है, यह बिना किसी हस्तक्षेप के ईवेंट को संभालने के लिए जारी रहता है ('requestDisallowInterceptTouchEvent()' विधि का उपयोग करके)। मेरा ऐप और लेआउट काफी जटिल और गोपनीय है, अगर आप इस मुद्दे के साथ न्यूनतम नमूना प्रोजेक्ट पोस्ट कर सकते हैं तो इससे मदद मिलेगी (ताकि मैं इसे डीबग कर सकूं)। – corsair992