6

के शीर्ष पर टैब सूचक दिखाने के लिए कैसे मैंने this tutorial का पालन किया। मैंने सरल परिवर्तन किया है जो स्क्रीन के नीचे TabLayout दिखाता है।टैब

activity_main.xml

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 


    <android.support.v4.view.ViewPager 
     android:id="@+id/viewpager_landing" 
     android:layout_width="match_parent" 
     android:layout_height="0px" 
     android:layout_weight="1" 
     android:background="@android:color/white" /> 

    <android.support.design.widget.TabLayout 
     android:id="@+id/sliding_tabs_landing" 
     style="@style/MyCustomTabLayout" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:tabMode="fixed" /> 

</LinearLayout> 

enter image description here

समस्या: -

TabIndicator अच्छी तरह से काम कर रहा स्क्रीन के तल पर दिखाई दे रहा है, अब मैं दिखाना चाहता हूँ कि TabIndicator टैब के शीर्ष पर नहीं बल्कि नीचे से कस्टम लेआउट का उपयोग करके हम ट्यूटोरियल में बताए गए अनुसार कर सकते हैं लेकिन क्या कोई एक्सएमएल विशेषता है जो शीर्ष पर TabIndicator दिखाएगी?

+0

अपने xml कोड डाल दिया। thx – Fakher

+0

@Fakher मैंने xml –

+0

@Nilesh पोस्ट किया है क्या आपने इसे हासिल किया है? मैं शीर्ष पर टैब संकेतक भी दिखाना चाहता हूं। –

उत्तर

0

यह मेरे लिए काम किया:

LinearLayout tabs = ((LinearLayout) tabLayout.getChildAt(0)); 

for (int position = 0; position < tabs.getChildCount(); position++) { 
    LinearLayout item = ((LinearLayout) tabs.getChildAt(position)); 
    item.setRotationX(180); 
} 
संबंधित मुद्दे