文章:Android中ScrollView使用詳解 Android中ScrollView的用法 ScrollView滾動視圖是指當擁有很多內容,屏幕顯示不完時,需要通過滾動跳來顯示的視圖。包括水平滾動視圖(HorizontalScrollView)和垂直滾動視圖(ScrollView)。 ScrollView和HorizontalScrollView下只能有一個控件,如果需要多個一起,則可以添加一個線性布局LinearLayout. 例如:
<?xml version="1.0" encoding="utf-8"?><ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="vertical"> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:src="@m需要隱藏滾動條://屬性設置android:scrollbars="none"http://代碼設置setHorizontalScrollBarEnabled(false);//隱藏橫向ScorollViewsetVerticalScrollBarEnabled(false);//隱藏縱向ScorollView去除頂部下拉時的半月形陰影和上下滑動頂部和底部的虛化: 這兩種在listview中同樣可以用
android:overScrollMode=“never”// 去除半月陰影android:fadingEdge=“none”//去除虛化效果文章: android listview/ScrollView 去除頂部下拉時的半月形陰影和上下滑動頂部和底部的虛化
了解更多屬性可以看這篇文章
android中ScrollView常用屬性匯總: android中ScrollView常用屬性匯總
新聞熱點
疑難解答