跳至主要內容

BlurTitlebarView


BlurTitlebarView

在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:showBackbooleanfalse是否显示返回按钮
app:backIconreference-返回图标资源
app:backIconTintcolor-返回图标色调
app:menuTextstring-菜单文本
app:menuTextColorcolor-菜单文本颜色
app:menuIconreference-菜单图标资源
app:menuIconTintcolor-菜单图标色调
app:centerTitlebooleanfalse是否居中显示标题

使用代码动态切换标题位置

blurTitlebarView.setCenterTitle(true);