android - 在 Android 中设置高程仍然在 ActionBar 下方显示阴影

标签 android xml android-layout android-studio android-actionbar

内部values/styles.xml我设置了<item name="elevation">0dp</item>到我的AppTheme风格。和里面values-21/styles.xml我设置了<item name="android:elevation">0dp</item>我也试过这个 <item name="android:windowContentOverlay">@null</item> .我也试过Clean项目和Rebuild该项目。并尝试Invalidate Caches and Restart .但是我的模拟器仍然显示阴影,请参见下面的屏幕。

问题:

如何去除 ActionBar 下方的阴影.

截图:

enter image description here

最佳答案

如果这是一个纯 ActionBar,而不是一个 Toolbar。这就是你的做法:

<style name="MyAppTheme" parent="Theme.AppCompat.Light">
  <item name="actionBarStyle">@style/FlatActionBar</item>
</style>

<style name="FlatActionBar" parent="Widget.AppCompat.Light.ActionBar.Solid">
  <item name="elevation">0dp</item>
</style>

关于android - 在 Android 中设置高程仍然在 ActionBar 下方显示阴影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37985505/

相关文章:

android - 如何在 Android 中复制 iOS 7 模糊 View

python - 如何进行线程安全的 python XML 验证?

xml - 属性不等于或不存在的元素的 XPath

android - 应用程序 :srcCompat in xml 的 InflateException

android - 动画添加到 Nexus4 与其他设备上的 Activity 的新 TextView 的问题

android - 可以在 Android 中制作 hive XML 布局吗?

android - Android模拟器中GPS信号模拟丢失

android - javax.net.ssl.SSLException : Read error: ssl=0x9524b800: I/O error during system call, 连接由对等方重置

java - 使用 Dagger 2 进行 Presenter 注入(inject)

android - 如何修复我的 onclick 监听器,以便我不必单击两次即可在单击标题时触发事件?