<com.wuhenzhizao.titlebar.widget.CommonTitleBar
xmlns:titlebar="http://schemas.android.com/apk/res-auto"
android:id="@+id/titlebar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
titlebar:titleBarColor="color" // 标题栏背景颜色
titlebar:fillStatusBar="boolean" // 填充状态栏,true时,标题栏会创建一块和系统状态栏同高的视图,用于沉浸式标题栏
titlebar:statusBarColor="color" // 使用沉浸式标题栏时,标题栏显示的颜色
titlebar:statusBarMode="dark|light" // 状态栏图标模式,默认是暗色图标
titlebar:titleBarHeight="dimension" // 标题栏高度
titlebar:showBottomLine="boolean" // 是否显示标题栏底部的分割线
titlebar:bottomLineColor="color" // 标题栏分割线颜色
titlebar:bottomShadowHeight="dimension" // 底部阴影高度 showBottomLine = false时有效
titlebar:leftType="none|textView|imageButton|customView" // 左侧视图类型:无|文字|按钮|自定义视图
titlebar:leftText="string" // 左侧文字leftType= textView有效
titlebar:leftTextColor="color" // 左侧文字颜色
titlebar:leftTextSize="dimension" // 左侧文字大小
titlebar:leftDrawable ="reference" // leftType= textView时,对应的drawableLeft图片
titlebar:leftDrawablePadding="dimension" // leftType= textView时,对应的drawablePadding
titlebar:leftImageResource="reference" // leftType= imageButton时,左侧按钮对应的图片资源引用
titlebar:leftCustomView ="reference" // leftType= customView时,左侧布局资源引用
titlebar:rightType="none|textView|imageButton|customView" // 右侧视图类型:无|文字|按钮|自定义视图
titlebar:rightText="string" // 右侧文字rightType= textView有效
titlebar:rightTextColor="color" // 右侧文字颜色
titlebar:rightTextSize="dimension" // 右侧文字大小
titlebar:rightImageResource="reference" // rightType= imageButton时,右侧按钮对应的图片资源引用
titlebar:rightCustomView="reference" // rightType= customView时,右侧布局资源引用
titlebar:centerType="none|textView|searchView|customView" // 中间视图类型:无|文字|搜索框|自定义视图
titlebar:centerSearchRightType="voice|delete" // 搜索框右侧按钮类型:语音按钮|删除按钮
titlebar:centerText="string" // 标题文字centerType = textView有效
titlebar:centerTextColor="color" // 标题文字颜色
titlebar:centerTextSize="dimension" // 标题文字大小
titlebar:centerTextMarquee="boolean" // 标题文字跑马灯效果,默认true
titlebar:centerSubText="string" // 副标题文字
titlebar:centerSubTextColor="color" // 副标题文字颜色
titlebar:centerSubTextSize="dimension" // 副标题文字大小
titlebar:centerSearchEdiable="boolean" // 搜索框是否可以输入,对应centerType =searchView
titlebar:centerSearchBg="reference" // 搜索框背景
titlebar:centerCustomView="reference"/> // 中间自定义视图
动态切换状态栏图标颜色:
titleBar.toggleStatusBarMode();
注意点:
如果出现全屏与键盘的冲突导致的键盘被遮挡问题,请在Activity.onAttachedToWindow()方法中加入如下代码,或在布局根节点加入 fitSystemWindow=true
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
KeyboardConflictCompat.assistWindow(getWindow());
}
若出现页面其他输入组件无法自动获取焦点的情况,请修改配置:
titlebar:centerTextMarquee="false"
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
CommonTitleBar.zip (33个子文件)
CommonTitleBar
proguard-rules.pro 935B
src
test
java
com
wuhenzhizao
ExampleUnitTest.java 393B
androidTest
java
com
wuhenzhizao
ExampleInstrumentedTest.java 749B
main
res
drawable-xhdpi
comm_titlebar_progress_circular.png 413B
comm_titlebar_voice.png 1KB
comm_titlebar_delete_normal.png 1002B
comm_titlebar_back_normal.png 431B
comm_titlebar_search_normal.png 1KB
drawable
comm_titlebar_layout_selector.xml 486B
comm_titlebar_reback_selector.xml 382B
comm_titlebar_search_white_shape.xml 153B
comm_titlebar_bottom_shadow.xml 242B
comm_titlebar_search_gray_shape.xml 153B
comm_titlebar_progress_draw.xml 233B
color
comm_titlebar_text_selector.xml 356B
drawable-ldrtl
comm_titlebar_back_normal.png 248B
values
strings.xml 127B
attrs.xml 5KB
anim
slide_right_out.xml 225B
slide_left_out.xml 226B
slide_out_right.xml 295B
slide_right_in.xml 226B
slide_in_right.xml 295B
slide_left_in.xml 225B
java
com
wuhenzhizao
titlebar
statusbar
FlymeStatusBarUtils.java 7KB
OSUtils.java 3KB
StatusBarUtils.java 8KB
widget
CommonTitleBar.java 45KB
utils
KeyboardConflictCompat.java 3KB
ScreenUtils.java 4KB
AndroidManifest.xml 273B
build.gradle 1KB
CommonTitleBar.txt 4KB
共 33 条
- 1
资源评论
安静的男孩
- 粉丝: 987
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功