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.

material design tabs

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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -