[英]How to disable or change color for black rows while ListView scrolling
同事們,請提出建議,我該如何刪除在ListView滾動條上顯示的黑線(請參閱屏幕截圖)或將其禁用?
要動態地使用方法.setVerticalFadingEdgeEnabled()
或者,在XML布局中,您可以使用標簽android:fadingEdge="none"
(貸記為nicky )
在滾動視圖的android xml布局中
android:fadingEdge =“ none”
廣告這個
請不要只關閉此功能。 對於用戶來說,這是一項重要的UI功能,它可以知道列表上方和/或下方還有更多內容,而將其關閉會使您的UI與平台的其余部分行為不一致。
如果要使用自定義背景色,最好的方法是制作自己的主題背景色。 這樣,當需要顯示應用程序的預覽時,它將更好地匹配您的實際用戶界面,主題將自動使用這種顏色來處理淡入淡出的事情。 這是您可以放入res / values / styles.xml文件中的示例,使您可以通過android:theme="@style/CustomTheme"
為應用程序或單個活動設置android:theme="@style/CustomTheme"
。
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="custom_theme_color">#b0b0ff</color>
<style name="CustomTheme" parent="android:Theme.Light">
<item name="android:windowBackground">@color/custom_theme_color</item>
<item name="android:colorBackground">@color/custom_theme_color</item>
</style>
</code>
(很抱歉,語法有點奇怪-這是因為android:windowBackground當前只能提供對資源的引用,而不是恆定的顏色。)
有關在聲明主題時可以使用的屬性的列表,請參見:
http://developer.android.com/reference/android/R.styleable.html#Theme
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.