android - change the size of Fragment tabs using ViewPager -
i want change size of fragment tabs. there way?? can change size of fragment tabs created using view pager , fragments ??
solved. need implement material design classes resize it. material design tabs new , best solution tabs. classes provided google.
from given link download both following classes,
slidingtablayout.java
slidingtabstrip.java
and have same viewpager.
need implement following in mainactivity.xml can customize size of tabs.
<com.example.android.tabs.slidingtablayout android:layout_width="match_parent" android:layout_height="35dp" //size of tabs. android:layout_margintop="1dp" android:id="@+id/tabs"/>
and add tabs viewpager,
mpager.setadapter(new myadapter(getsupportfragmentmanager())); mtabs.setviewpager(mpager);
you can change size of tabs way want. hope helps :)
Comments
Post a Comment