android:scrollbar的一些属性
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
- <ScrollView
- android:id="@+id/view1"
- android:layout_width="100dip"
- android:layout_height="120dip"
- android:background="@android:color/white"
- android:padding="8dip"
- android:scrollbarStyle="insideOverlay" >
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@android:color/darker_gray"
- android:text="scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text"
- android:textColor="#ffffff" />
- </ScrollView>
- <ScrollView
- android:id="@+id/view2"
- android:layout_width="100dip"
- android:layout_height="120dip"
- android:background="@android:color/white"
- android:padding="8dip"
- android:scrollbarStyle="insideInset" >
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@android:color/darker_gray"
- android:text="scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text"
- android:textColor="#ffffff" />
- </ScrollView>
- <ScrollView
- android:id="@+id/view3"
- android:layout_width="100dip"
- android:layout_height="120dip"
- android:background="@android:color/white"
- android:padding="8dip"
- android:scrollbarStyle="outsideOverlay" >
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@android:color/darker_gray"
- android:text="scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text"
- android:textColor="#ffffff" />
- </ScrollView>
- <ScrollView
- android:id="@+id/view4"
- android:layout_width="100dip"
- android:layout_height="120dip"
- android:background="@android:color/white"
- android:padding="8dip"
- android:scrollbarStyle="outsideInset" >
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@android:color/darker_gray"
- android:text="scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text scroll_text"
- android:textColor="#ffffff" />
- </ScrollView>
- </LinearLayout>
2. 运行结果截图:insideInset、insideOverlay、outsideInset、outsideOverlay分别对应下图左边解释!
其中inside和outside分别表示是否在view的padding区域内,overlay和inset表示覆盖在view上或是插在view后面,所以四种值分别表示:
insideOverlay:默认值,表示在padding区域内并且覆盖在view上
insideInset:表示在padding区域内并且插入在view后面
outsideOverlay:表示在padding区域外并且覆盖在view上
outsideInset:表示在padding区域外并且插入在view后面
android:scrollbars="vertical"
android:fadeScrollbars="true" //true scrollbar不滚动隐藏
android:scrollbarThumbVertical="@drawable/scrollbar" //自定义scrollbar
android:scrollbarTrackHorizontal="@drawable/scrollbar_bg" //自定义scrollbar背景
android:scrollbarStyle="outsideInset" //scrollbar风格
android:scrollbar的一些属性的更多相关文章
- Android -----listView的重要属性
android:transcriptMode="alwaysScroll" android:cacheColorHint="#00000000" android ...
- android中xml tools属性详解
第一部分 安卓开发中,在写布局代码的时候,ide可以看到布局的预览效果. 但是有些效果则必须在运行之后才能看见,比如这种情况:TextView在xml中没有设置任何字符,而是在activity中设置了 ...
- Android读取自定义View属性
Android读取自定义View属性 attrs.xml : <?xml version="1.0" encoding="utf-8"?> < ...
- android中xmlns:tools属性详解
今天读到一篇总结的非常棒的文章,写的逻辑很清晰也很实用,很少见到如此棒的文章了.就原文转发过来,我把格式给整理了一下,分享给园子里的各位朋友!好久没写博客了,就为2015年的11月留份纪念吧.希望对你 ...
- Mono for Android布局控件属性小结
1. layout_weight 用于给一个线性布局中的诸多视图的重要度赋值. 所有的视图都有一个layout_weight值,默认为零,意思是需要显示 多大的视图就占据多大的屏幕空 间.若赋一个高于 ...
- 【Android】使用persist属性来调用脚本文件
Android系统中有许多属性,属性由两个部分组成:name & value,可以使用这些属性来记录系统设置或进程之间的信息交换.Android系统在启动过程时会按序从以下几个文件中加载系统属 ...
- Android开发之EditText属性详解
1.EditText输入的文字为密码形式的设置 (1)通过.xml里设置: 把该EditText设为:android:password="true" // 以”.”形式显示文本 ( ...
- android控件的属性
android控件的属性 本节描述android空间的位置,内容等相关属性及属性的含义 第一类:属性值为true或false android:layout_centerHrizontal 水平居中 ( ...
- 【转】 Android开发之EditText属性详解
原文网址:http://blog.csdn.net/qq435757399/article/details/7947862 1.EditText输入的文字为密码形式的设置 (1)通过.xml里设置: ...
随机推荐
- 【一个比较bug free的二分写法】
lower_bound: [l, r)区间内大于等于val的第一个位置 int lower_bound(int l, int r, int val){ while(l < r){ ); if(a ...
- py2exe error: [Errno 2] No such file or directory: 'MSVCP90.dll'
使用 python setup.py py2exe 打包时出现 py2exe error: [Errno 2] No such file or directory: 'MSVCP90.dll' 解决方 ...
- git repo gerrit 的关系
Git作为一个版本控制工具,功能很强大,新建分支,切换分支都很快,小团队用Git就能很好地管理好了,但如果是Android系统如此庞大的工程呢,我们知道全套Android源码是很大很大的,目录结构也很 ...
- VIM的修炼等级
用vim 快两年了 看过教程也不少,总的来说还是得自己多练习,当自己觉得有需要的时候,再添加功能.这里分享个看过的最好的教程,出自贴吧的某个朋友,写的很好 零 学会盲打 壹 配置文件先从最简开始,在 ...
- linux内核之系统调用nanosleep与pause()
nanosleep()使得进程进入睡眠状态,指定时候后唤醒进程,sleep()基于其实现 asmlinkage long sys_nanosleep(struct timespec *rqtp, st ...
- LeetCode OJ--Multiply Strings **
https://oj.leetcode.com/problems/multiply-strings/ 用字符串实现大数乘法,细节题,细节很多 class Solution { public: stri ...
- Codeforces 761E Dasha and Puzzle(构造)
题目链接 Dasha and Puzzle 对于无解的情况:若存在一个点入度大于4,那么直接判断无解. 从根结点出发(假设根结点的深度为0), 深度为0的节点到深度为1的节点的这些边长度为2^30, ...
- HDFS写文件过程分析
转自http://shiyanjun.cn/archives/942.html HDFS是一个分布式文件系统,在HDFS上写文件的过程与我们平时使用的单机文件系统非常不同,从宏观上来看,在HDFS文件 ...
- js 日期计算星座 根据生日的月份和日期,一行代码计算星座的js小函数(转)
本博客根据 开源中国作者清风徐不来 的文章 根据生日的月份和日期,一行代码计算星座的js小函数(转) 原文出自CSDN 无心的专栏 的文章,知识产权归原文作者所有! 点击查看原文:js 日期计算星座
- 蒙特卡洛法MATLAB
%%unifrnd函数的使用 %unifrnd函数可以创建随机的连续均匀分布的数组,一般式为R=unifrnd(A,B); %A和B是标量或者相同维数的行向量或者列向量.R=unifrnd(A,B,[ ...