我正在使用Android Studio進行編程。目標SDK是23和最低SDK是15我如何刪除android動作欄Shadow
我試圖刪除我的操作欄和我的滑動標籤佈局之間的陰影。但我無法。
注意:陰影僅在Android 5及更高版本中可見。
我已經使用<item name="elevation">0dp</item>
和getSupportActionBar().setElevation(0);
但還是不起作用......
我Style.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light">
<item name="elevation">0dp</item>
</style>
我的風格V21
<resources>>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
我MainActivity.java onCreateCode:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setElevation(0);
....
謝謝男人謝謝你loooooooooooooot 我感動的選項卡appbar也和其固定 謝謝你,祝你好運 –
你」歡迎。如果它解決了您的問題,請不要忘記接受或註冊我的答案。 –
感謝它的工作 –