美文网首页
安卓沉浸栏样式

安卓沉浸栏样式

作者: 上帝死了众神在堕落 | 来源:发表于2022-03-02 14:38 被阅读0次

如果实现沉浸式状态栏呢

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ff66ff"
    android:fitsSystemWindows="true">

    <com.google.android.material.appbar.CollapsingToolbarLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop"
            android:src="@drawable/bg"
            android:fitsSystemWindows="true"
            />

    </com.google.android.material.appbar.CollapsingToolbarLayout>

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button"
        />

</androidx.coordinatorlayout.widget.CoordinatorLayout>

相关文章

  • 安卓沉浸栏样式

    如果实现沉浸式状态栏呢

  • 安卓沉浸状态栏

    使用安卓几年了,之前对安卓沉浸式状态栏很有好感,现在学习安卓开发就研究了一番,期间看了不是前辈的博客,学到不上东西...

  • Toolbar

    ActionBar Android 3.0之后,Google引入了ActionBar,想统一安卓应用的导航栏样式。...

  • Android Toolbar,你想知道的都在这里了

    Android 3.0之后,Google引入了ActionBar,想统一安卓应用的导航栏样式。但由于ActionB...

  • 安卓4.4沉浸式状态栏自定义与5.0统一

    一.概述 安卓自4.4版本支持一种半透明状态栏的效果,在国内更多称之为沉浸式顶栏. 二.沉浸式状态栏的实现 1.引...

  • 安卓沉浸式状态栏

    1 在res目录下创建value-21,创建styles文件 2 用如下代码定义apptheme 3 在布局所在的...

  • 安卓沉浸式状态栏

    当你升级到androidx后,将会向下兼容,我测试到安卓6.0以上都支持首先添加依赖: 在你的activity中写...

  • MaterialDesign--(6)Toolbar的使用及其源

    简介 Android 3.0之后,Google引入了ActionBar,想统一安卓应用的导航栏样式。但由于Acti...

  • toolbar总结及简单封装

    Android3.0之后,Google引入了ActionBar,想统一安卓应用的导航栏样式。但由于ActionBa...

  • 什么是ToolBar?

    一、简介 Android3.0之后,Google引入了ActionBar,想要统一安卓应用的导航栏样式。但是由于A...

网友评论

      本文标题:安卓沉浸栏样式

      本文链接:https://www.haomeiwen.com/subject/cvosrrtx.html