关于android:scrollbarStyle属性 分类: Android开发 2014-05-30 10:57 50人阅读 评论(0) 收藏

http://blog.csdn.net/duanyipeng/article/details/8591575

1. activity_maim.xml

[html] view plaincopy
  1. <</span>LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  2.     android:layout_width="fill_parent"  
  3.     android:layout_height="fill_parent"  
  4.     android:orientation="vertical" >  
  5.   
  6.     <</span>ScrollView  
  7.         android:id="@+id/view1"  
  8.         android:layout_width="100dip"  
  9.         android:layout_height="120dip"  
  10.         android:background="@android:color/white"  
  11.         android:padding="8dip"  
  12.         android:scrollbarStyle="insideOverlay" >  
  13.   
  14.         <</span>TextView  
  15.             android:layout_width="fill_parent"  
  16.             android:layout_height="wrap_content"  
  17.             android:background="@android:color/darker_gray"  
  18.             android:text="scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text"  
  19.             android:textColor="#ffffff" />  
  20.     </</span>ScrollView>  
  21.   
  22.     <</span>ScrollView  
  23.         android:id="@+id/view2"  
  24.         android:layout_width="100dip"  
  25.         android:layout_height="120dip"  
  26.         android:background="@android:color/white"  
  27.         android:padding="8dip"  
  28.         android:scrollbarStyle="insideInset" >  
  29.   
  30.         <</span>TextView  
  31.             android:layout_width="fill_parent"  
  32.             android:layout_height="wrap_content"  
  33.             android:background="@android:color/darker_gray"  
  34.             android:text="scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text"  
  35.             android:textColor="#ffffff" />  
  36.     </</span>ScrollView>  
  37.   
  38.     <</span>ScrollView  
  39.         android:id="@+id/view3"  
  40.         android:layout_width="100dip"  
  41.         android:layout_height="120dip"  
  42.         android:background="@android:color/white"  
  43.         android:padding="8dip"  
  44.         android:scrollbarStyle="outsideOverlay" >  
  45.   
  46.         <</span>TextView  
  47.             android:layout_width="fill_parent"  
  48.             android:layout_height="wrap_content"  
  49.             android:background="@android:color/darker_gray"  
  50.             android:text="scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text"  
  51.             android:textColor="#ffffff" />  
  52.     </</span>ScrollView>  
  53.   
  54.     <</span>ScrollView  
  55.         android:id="@+id/view4"  
  56.         android:layout_width="100dip"  
  57.         android:layout_height="120dip"  
  58.         android:background="@android:color/white"  
  59.         android:padding="8dip"  
  60.         android:scrollbarStyle="outsideInset" >  
  61.   
  62.         <</span>TextView  
  63.             android:layout_width="fill_parent"  
  64.             android:layout_height="wrap_content"  
  65.             android:background="@android:color/darker_gray"  
  66.             android:text="scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text"  
  67.             android:textColor="#ffffff" />  
  68.     </</span>ScrollView>  
  69.   
  70. </</span>LinearLayout>  

 

2. 运行结果截图:


3. 相关说明:

insideInset、insideOverlay、outsideInset、outsideOverlay分别对应上图右边解释!

版权声明:本文为博主原创文章,未经博主允许不得转载。

posted @ 2014-05-30 10:57  leansmall  阅读(87)  评论(0编辑  收藏  举报