当前位置: 移动技术网 > IT编程>移动开发>Android > Android TitleBar推荐

Android TitleBar推荐

2019年09月04日  | 移动技术网IT编程  | 我要评论

金雅中整容,369手游网,巢邦网

版权声明:本文为xing_star原创文章,转载请注明出处!

本文同步自

android titlebar推荐

这段时间在帮别人写一个app,为了加快进度,就引入了一些开源库,其中一个是titlebar,github上的地址是   , slogan是满足各种日常使用的标题栏,不要让你的时间浪费在写标题栏上。听起来很不错。
 
在build.gradle里面引入远程依赖
implementation 'com.github.loperseven:titlebar:1.0.3'
 
在activity或者是fragment的xml布局里面只需要使用titlebar就可以了,如<com.loper7.layout.titlebar
android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    tl:tbackgroundcolor="@color/colorprimary"
    tl:ttitletext="活动"
    tl:ttitletextcolor="@color/black"
    tl:tcentertitle="true"
    tl:ttitletextbold="true"
    tl:ttitletextsize="18sp" />

 

上面基本上默认的配置,如果需要设置左边的返回箭头,可以使用tbackimage来设置箭头图标。
其他的属性用法,可以参考文档或者是源码,比较简单。
这样后续就不用重复的写titlebar了。
 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网