में बाएं, ऊपर, दाएं या नीचे बाईं ओर टैबलाउट आइकन बदलना मैं एंड्रॉइड विकास के लिए काफी नया हूं। तो मेरे साथ सहन करो।com.android.support:design:23.1.0
मैं एक दिन में com.android.support:design:23.1.0 में उसी पंक्ति में आइकन और टेक्स्ट को संरेखित करने का प्रयास कर रहा हूं।
स्पष्ट रूप से com.android.support:design: 23.1.0 उन्होंने डिफ़ॉल्ट आइकन स्थिति को शीर्ष पर और नीचे पाठ को बदल दिया है।
com.android.support:design मेंपहले: 23.0.1 डिफ़ॉल्ट
तो यहाँ एक आसान तरीका हालांकि इसे हल करने (है चिह्न के रूप में एक ही पंक्ति में छोड़ दिया और पाठ पर आइकन था यह कमियां हो सकता है, tbh idk):
change the version in your app's build.gradle. ex: 23.1.0 to 23.0.1 and build.
और वहाँ इसे इस तरह आप भी बाएँ, दाएँ, ऊपर, नीचे माउस पर संरेखित कर सकते हैं) करने के लिए (एक बेहतर तरीका है:
- रेस में एक custom_tab.xml बनाने/लेआउट
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="center"/>
अपनी गतिविधि जावा में 2.
TextView newTab = (TextView) LayoutInflater.from(this).inflate(R.layout.custom_tab, null);
newTab.setText("tab1"); //tab label txt
newTab.setCompoundDrawablesWithIntrinsicBounds(your_drawable_icon_here, 0, 0, 0);
tabLayout.getTabAt(tab_index_here_).setCustomView(newTab);
अब तक मैं माउस बनाने के लिए हासिल कर लिया है किसी भी पक्ष पर प्रकट इस तरह:
पुनश्च: setCompoundDrawablesWithIntrinsicBounds समारोह तर्क इस तरह 4 पक्ष प्रतीक हैं:
setCompoundDrawablesWithIntrinsicBounds(leftDrawable, topDrawable, rightDrawable, bottomDrawable)
इस एचटी पर जाएं टीपी: //www.androidhive.info/2015/09/android-material-design-working-with-tabs/ आपकी मदद कर सकता है –