我想为我的应用程序(用于 kitkat)添加半透明状态栏和导航,并且在大多数地方都可以正常工作。
我有一个主题:
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowTranslucentStatus">true</item>
在我的布局中,我有 android:fitsSystemWindows="true"
对于正常 Activity ,这可以正常工作,但我有两个 Activity 会造成麻烦。 -> 内容显示在状态栏和我的操作栏后面。
其中一个是 PreferenceActivity,我通过添加 findViewById(android.R.id.list).setFitsSystemWindows(true);
第二个是带有 ActionBar.NAVIGATION_MODE_TABS
的 Activity,我找不到 setFitsSystemWindows(true)
调用的正确目标。
我尝试使用 findViewById(android.R.id.content)
和 findViewById(android.R.id.tabcontent)
。我还尝试将 xml 属性添加到 fragment 的布局中,但没有成功。
最佳答案
在您的工具栏上添加一个 25 dp 的 paddingTop
关于android - android 4.4 的标签和半透明状态栏/导航出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20842550/