当前位置: 首页 > news >正文

网站建设和优化的步骤无锡互联网

网站建设和优化的步骤,无锡互联网,网架生产企业,公众号官网登录背景:android api 35,activity设置EdgeToEdge.enable((ComponentActivity) this)前提下 一、设置导航栏与状态栏颜色 设置的状态栏颜色,只需要设置fitsSystemWindows跟setOnApplyWindowInsetsListener xml设置: 代码:…

背景:android api 35,activity设置EdgeToEdge.enable((ComponentActivity) this)前提下
一、设置导航栏与状态栏颜色
设置的状态栏颜色,只需要设置fitsSystemWindows跟setOnApplyWindowInsetsListener
xml设置:
在这里插入图片描述
代码:

		getWindow().setNavigationBarContrastEnforced(false);ViewCompat.setOnApplyWindowInsetsListener(mMyGameRecycler, (v, windowInsets) -> {Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());v.setPadding(insets.left, v.getPaddingTop(), insets.right, insets.bottom);return WindowInsetsCompat.CONSUMED;});
ViewCompat.setOnApplyWindowInsetsListener(mMyGameRecycler, (v, windowInsets) -> {Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());v.setPadding(insets.left, v.getPaddingTop(), insets.right, insets.bottom);return WindowInsetsCompat.CONSUMED;});

二,设置导航栏自定义颜色半透明
布局activity_my_game.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:background="@color/white"android:orientation="vertical"><Viewandroid:id="@+id/view_tool"android:layout_width="match_parent"android:layout_height="30dp"android:background="@color/white" /><include layout="@layout/toolbar_custom" /><FrameLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"><androidx.recyclerview.widget.RecyclerViewandroid:id="@+id/swipe_target"android:layout_width="match_parent"android:layout_height="match_parent"android:overScrollMode="never" /><com.zhiyicx.baseproject.widget.EmptyViewandroid:id="@+id/empty_view"android:layout_width="match_parent"android:layout_height="match_parent"/></FrameLayout>
</LinearLayout>

代码层面:

		//设置导航栏与状态栏图标颜色StatusBarUtils.setStatusBarLightMode(this.getWindow(), true);StatusBarUtils.setNavigationBarLightMode(this.getWindow(), true);//设置导航栏背景颜色与透明度,注意:如果布局fitsSystemWindows 为true时则不生效int bgcolor = Color.argb(0xe6, 0xFF, 0xFF,  0xFF);getWindow().setNavigationBarColor(bgcolor);//设置列表布局滑动时在导航栏背后,滑动到底时在导航栏顶部mMyGameRecycler.setClipToPadding(false);ViewCompat.setOnApplyWindowInsetsListener(mMyGameRecycler, (v, windowInsets) -> {Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());v.setPadding(insets.left, v.getPaddingTop(), insets.right, insets.bottom);return WindowInsetsCompat.CONSUMED;});

注意:

  • 设置导航栏颜色时需要添加getWindow().setNavigationBarContrastEnforced(false),但是设置半透明时需要移除该行代码
  • 当设置fitsSystemWindows 时setNavigationBarColor会不生效
http://www.yayakq.cn/news/228623/

相关文章:

  • 深业资本有限公司网站建设引擎优化是什么工作
  • 佛山营销网站建设费用如何生成自己的小程序
  • 怎么看网站有没有被kseo长沙
  • 企业为什么要网站建设网站开发 多语言
  • 免费软件app网站下载大全可以用来做网页的软件
  • 三否网站苏州网站建设外贸
  • 做任务打字赚钱的网站会员卡管理系统软件
  • 网站换服务器怎么做物流网站开题报告
  • 网站常用配色海宁网站建设公司推荐
  • 出口家具东莞网站建设软文范例大全100
  • 快速创建网站沈阳网站建设教案模板
  • 网站帮企业做推广价格怎么算网站建设找哪里
  • 怎么用网站做调查表广安网站制作设计
  • 灌云网站建设维护阿里云esc 可以做几个网站
  • 网站建设与制作设计公司不常见的网络营销方式
  • 江阴网站建设保洁公司开发app
  • 建站公司是什么世界著名建筑设计公司
  • 长春建站模板评测网站备案名称中国开头
  • 重庆微信网站开发网站建设案例新闻
  • 多语言企业网站建设费用开发公司房价制定
  • 江门专业网站建设系统百度指数大数据分享平台
  • 网站建设需要多少做外贸开店用哪个网站
  • 轴承推广做哪个网站买软件网站建设
  • 网站排名超快网络工程属于计算机类吗
  • 网站空间代理wordpress 获取有图片的文章
  • 织梦网站首页微信小程序电脑端打开
  • 网站模拟课堂模式应该怎么做哪个找房网站好
  • 成都pc网站建设建筑智库免费网站
  • 北京建设银行对公网站莱阳网站建设公司
  • 计算机专业论文网站开发怎么被百度收录