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

背景:

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

解决方案:

     在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>

   2.HomeActivity.java 

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

猜你喜欢

转载自blog.csdn.net/yinxing2008/article/details/82383695