नीचे धक्का देता है मेरे पास xml
फ़ाइल है जो 1) टूलबार 2) टैबलाउट 3) कस्टम व्यू और 4) व्यूपेगर। जब मैं AppBarLayout
अंदर Toolbar
, TabLayout
, Custom View
शब्दों में कहें, यह ViewPager
धक्का नीचे इस तरह के रूप में:Android AppBarLayout ViewPager को
xml
:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/feed_coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_tool_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleTextAppearance="@style/Widget.AppCompat.ActionBar.TabText"
app:layout_scrollFlags="scroll|enterAlways"
app:statusBarScrim="?attr/colorAccent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_alt"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/primary_color"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_collapseMode="none"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.design.widget.TabLayout
android:id="@+id/feed_sliding_tabs_alt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="fill"
app:tabMode="fixed"
app:tabSelectedTextColor="@color/accent_color"
app:tabTextColor="@color/accent_color_per_70" />
<LinearLayout
android:id="@+id/activity_feed_fl_canli_skor"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="@drawable/mac_back"
android:orientation="vertical">
</LinearLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/activity_feed_alt_view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/floating_action_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:src="@drawable/ic_feed_new_post"
android:theme="@style/FabTheme"
android:visibility="invisible"
app:backgroundTint="@color/primary_color"
app:borderWidth="0dp"
app:layout_anchor="@id/feed_coordinator_layout"
app:layout_anchorGravity="bottom|right|end" />
</android.support.design.widget.CoordinatorLayout>
जब मैं नीचे स्क्रॉल, Toolbar
छिपा हुआ हो जाता है जो अच्छा है। लेकिन मेरा ViewPager
मुख्य स्क्रीन ओवरफ्लो और ViewPager
के नीचे दिखाई नहीं देता है। मैं क्या कोशिश कर सकता हूँ?
जब मैं Toolbar
स्क्रॉल करता हूं तो अदृश्य हो जाता है और ViewPager
खींच लिया जाता है और स्क्रीन में पूरी तरह से दिखाई देता है। लेकिन Toolbar
केवल ViewPager
के पहले पृष्ठ की स्क्रॉल करने का जवाब देता है। चाल: मेरा पूरा
android:paddingBottom="?attr/actionBarSize"
तो: अभी के लिए मैं ViewPager अंदर frament को
एक ही मुद्दे में भाग लें और कोऑर्डिनेटरलाइट को हटा दें और इसे लाइनरलायआउट के साथ प्रतिस्थापित करें ताकि ViewPager स्क्रीन को ओवरफ़्लो न हो सके। मेरे लिए ऐसा करना आसान है। हालांकि दूसरों के लिए सबसे अच्छा समाधान नहीं हो सकता है। –
हाय, मुझे एक ही समस्या है। क्या आपने इसे ठीक करने में कामयाब रहे? –
@GeorgiKoemdzhiev nope, केवल ViewPager के अंदर खंड के नीचे पैडिंग जोड़ना, इसलिए खंड के नीचे –