Skip to content

BlurTitlebarView

在XML布局中使用

xml
<com.qmdeve.blurview.widget.BlurTitlebarView
    android:id="@+id/blurTitlebar1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:overlayColor="#D1FFFFFF"
    app:blurRadius="30dp"
    app:showBack="true"
    app:menuIcon="?android:attr/actionModeWebSearchDrawable"
    app:titleText="Title Test"
    app:subtitleText="Subheading Test"
    app:centerTitle="false"/>

属性说明

属性名类型描述
app:titleTextstring标题文本
app:subtitleTextstring副标题文本
app:titleTextColorcolor标题颜色
app:subtitleTextColorcolor副标题颜色
app:showBackboolean是否显示返回按钮
app:backIconreference返回图标资源
app:backIconTintcolor返回图标着色
app:menuTextstring菜单文本
app:menuTextColorcolor菜单文本颜色
app:menuIconreference菜单图标资源引用
app:menuIconTintcolor菜单图标着色
app:centerTitleboolean标题居中显示

使用代码设置标题居中显示

java
blurTitlebarView.setCenterTitle(true);