安卓开发

安卓全屏时导航栏覆盖App底部导航栏问题

2018-10-12  本文已影响123人  蓝不蓝编程

背景:

我们的主界面设置了全屏,安卓的虚拟虚拟按键覆盖了底部导航栏,导致无法操作底部导航栏。

解决方案:

在activity对应的style主题配置中删除:android:windowTranslucentNavigation或者设置该属性为false。

Demo:

1.styles.xml

<resources>
    <style name="HomeAcivityTheme" parent="AppTheme">
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:windowTranslucentNavigation">false</item>
    </style>
</resources>
image.gif

2.HomeActivity.java

<activity
            android:name=".HomeActivity"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/HomeAcivityTheme"
            android:windowSoftInputMode="adjustPan|stateHidden" />

安卓开发技术分享: https://www.jianshu.com/p/442339952f26

上一篇 下一篇

猜你喜欢

热点阅读