मैं सामग्री डिजाइन के संबंध में एक महान demo here का संदर्भ दे रहा हूं। इसमें टैब हैं, लेकिन जब मैं बहुत अधिक जोड़ता हूं तो टैब आइटम squished (स्क्रीनशॉट देखें)। मैं इसे क्षैतिज स्क्रॉल कैसे कर सकता हूं?Google Play जैसे टैब में क्षैतिज स्क्रॉल कैसे सक्षम करें?
मैं नीचे का मानना है कि लेआउट मैं परिवर्तन करना चाहिए है, लेकिन मैं डॉक्स कंघी और यह, कृपया मदद पाने के लिए प्रतीत नहीं कर सकते हैं!
<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/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_done" />
</android.support.design.widget.CoordinatorLayout>
आप 'HorizontalScrollingView' में अपने' TabLayout' डाल की कोशिश की? –
हे @ एन 1to ने काम किया! कृपया उत्तर के रूप में छोड़ दें और मैं स्वीकार करूंगा। मैं बस के साथ '' TabLayout' लिपटे '। केवल एक चीज है जब मैं स्क्रीन से एक टैब पर स्वाइप करता हूं, यह उस टैब पर ध्यान केंद्रित नहीं करता है। –
TruMan1
ऐसा न करें, टैबलाउट स्वयं ही क्षैतिज स्क्रॉलव्यू है। आप MODE_SCROLLABLE में TabLayout (यह डॉक्स में है) – BladeCoder