簡體   English   中英

如何在概覽模式下移除應用程序周圍的白色邊框

[英]How to remove white border around app in overview mode

正如您在圖像中看到的,在“概覽”模式下,我的應用程序在屏幕底部有一個非常細的白色邊框。 您還可以稍微看到頂部兩個角的白色邊框。 我已經將 AppTheme 的 windowBackground 設置為我喜歡的顏色。

我怎樣才能阻止這種情況發生? 我可以至少將白色更改為不同的顏色嗎?

*PS 在概覽中的應用程序之間滾動時,您可以看到白色邊框略微閃爍。

情況圖:

在此處輸入圖片說明

活動 XML 示例:

 <?xml version="1.0" encoding="utf-8"?> <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".Home.HomeFragment"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <!-- Middle Section (Body) --> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/containerRelativeView"> <include layout="@layout/layout_feed_viewpager"/> </RelativeLayout> <!-- Bottom Navigation --> <include layout="@layout/layout_navigation_view"/> </RelativeLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

樣式文件

 <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <!-- Change color of ripple effect on buttons --> <item name="colorControlHighlight">@color/label</item> <!-- Change color of EditText hint ex. Email, Password --> <item name="android:textColorHint">@color/white</item> <!-- Change color of navigation bar (this does not work for older phones) --> <item name="android:navigationBarColor">@color/windowBackground</item> <!-- Change background color of all activities --> <item name="android:windowBackground">@color/windowBackground</item> <!--<item name="android:background">@color/toolbar</item>--> </style> <!-- BottomNavigationTheme --> <style name="BottomNavigationTheme" parent="Theme.AppCompat.Light"> <item name="colorPrimary">@color/stylistic</item> <item name="android:textColorSecondary">@color/label</item> <!-- <item name="android:textSize">17sp</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" /> </resources>

顏色文件

 <?xml version="1.0" encoding="utf-8"?> <resources> <!-- General App Colors --> <color name="colorPrimary">#008577</color> <color name="colorPrimaryDark">#1A1E21</color> <color name="colorSecondary">#242A2E</color> <color name="colorAccent">#D81B60</color> <color name="colorStroke">#707070</color> <!-- Colors --> <color name="white">#FFFFFF</color> <!-- Specific Colors --> <color name="windowBackground">#1A1E21</color> <color name="label">#9E9F9F</color> <color name="search">#9AA0A6</color> <color name="navigation">#272E32</color> <color name="navigation_text">#606369</color> <!-- Fonts --> <color name="stylistic">#E3E4DF</color> <color name="sub_label">#5F6366</color> <!-- Shaded Colors --> <color name="translucentBlack">#10848D95</color> </resources>

你用

Theme.AppCompat.Light

但是您的調色板對於您的窗口背景來說似乎很暗。 那么為什么不嘗試使用不同的繼承主題呢? 喜歡:

Theme.AppCompat

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM