XTabLayout
发布日期:2021-05-07 19:05:56 浏览次数:24 分类:原创文章

本文共 1179 字,大约阅读时间需要 3 分钟。




This is a TabLayout. Its extra feature is to get the navigation bar icon out of his Parent.(这是一个增强版本的TabLayout,它额外增加的功能是提供底部栏图标能溢出它的父类.)









XTabLayout


This is a TabLayout. Its extra feature is to get the navigation bar icon out of his Parent.


(这是一个增强版本的TabLayout,它额外增加的功能是提供底部栏图标能溢出它的父类.) #Gradle Step 1. Add it in your root build.gradle at the end of repositories: allprojects { repositories { ... maven { url '' } } }


Step 2. Add the dependency	dependencies {	        compile 'com.github.sltpaya:XTabLayout:25.1.1'	}

#Picture 


#How to use


###Its usage is the same as TabLayout


//ViewPagerViewPager viewPager = (ViewPager) findViewById(R.id.xxx);viewPager.setAdapter(xxx);//TabLayoutBuilderTabLayoutBuilder tabLayout = (TabLayoutBuilder) findViewById(R.id.xxx);tabLayout.setupWithViewPager(viewPager);//setting up this TabLayout with ViewPagertabLayout.setBottomMargin(int dp);//set the bottomMargin --unit:dptabLayout.setTextSize(float sp);//set title size --unit:sptabLayout.addTab(new TabLayoutBuilder.ItemStatus(CharSequence title, @IdRes int drawableSelectorId, int normalTitleColor, int selectedTitleColor);//add tab to TabLayouttabLayout.build();//show tabView to your screen

上一篇:Android之ListView详解
下一篇:关于intent之android.intent.action.USER_PRESENT的接收与使用

发表评论

最新留言

表示我来过!
[***.240.166.169]2025年04月09日 20时25分24秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章