1. 发现问题
Android 系统的底部导航栏相比IOS 就粗糙很多,大多数是这样的   可以看到大多数不是透明的背景,看起来比较丑,影响显示效果。 但是google 从Android10开始就已经支持了这种导航方式,那么有没有一种方式可以像ios一样那?
因此我基于androidx.appcompat:appcompat:1.3.1 封装了一个SystemBarsCompat 其实就是一个utils ,也勉强算是一种解决方案吧!
2. 解决方案
注意:还在测试中,切勿盲目使用生产环境中,如果要使用请一定要测试一下
- Add the JitPack repository to your build file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency
dependencies {
implementation 'com.github.kouxinhong:SystemBarsCompat:0.1'
}
- Add Activity
SystemBars.instance.setSystemBars(
activity,
rootView,
navigationBarsColor,
bottomNavigationView,
true
)
SystemBars.instance.setNavigationBar(
activity,
rootView,
navigationBarColor,
bottomNavigationView,
true
)
3. 显示效果

详见:https://github.com/kouxinhong/SystemBarsCompat
|