I Tab Layout verwenden und hier ist mein Codeentfernen TabLayout links und rechts padding
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="center"
app:tabMode="fixed"
android:minHeight="?attr/actionBarSize"
app:tabTextColor="#000"
app:tabSelectedTextColor="#fff"
app:tabIndicatorColor="@android:color/white"
android:clipToPadding="false"
/>
Registerkarte wie dieser Registerkarte
Hinzufügen // Erstellen
Textview-tab = (Textview) LayoutInflater. von (diesem) .inflat (R.layout.custom_tab, null); tab.setText ("Home"); tab.setCompoundDrawablesWithIntrinsicBounds (0, R.mipmap.ic_home_black_24dp, 0, 0); tabLayout.addTab (tabLayout.newTab(). SetCustomView (tab));
TextView tab2 = (TextView) LayoutInflater.from(this).inflate(R.layout.custom_tab, null);
tab2.setText("Report");
tab2.setCompoundDrawablesWithIntrinsicBounds(0, R.mipmap.ic_trending_up_black_24dp, 0, 0);
tabLayout.addTab(tabLayout.newTab().setCustomView(tab2));
TextView tab3 = (TextView) LayoutInflater.from(this).inflate(R.layout.custom_tab, null);
tab3.setText("Medicine");
tab3.setCompoundDrawablesWithIntrinsicBounds(0, R.mipmap.ic_home_black_24dp, 0, 0);
tabLayout.addTab(tabLayout.newTab().setCustomView(tab3));
TextView tab4 = (TextView) LayoutInflater.from(this).inflate(R.layout.custom_tab, null);
tab4.setText("More");
tab4.setCompoundDrawablesWithIntrinsicBounds(0, R.mipmap.ic_trending_up_black_24dp, 0, 0);
tabLayout.addTab(tabLayout.newTab().setCustomView(tab4));
und hier ist mein Handy Screenshot
https://i.stack.imgur.com/kYNs1.png
Zwei Dinge 1.How kann ich Raum zu entfernen, die von links und rechts der Registerkarte Layout nimmt?
2.How kann ich die Farbe von Text und das Symbol der aktiven und inaktiven Tab
verwenden app: tabPadding eigenschaft –