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里设置: ...
随机推荐
- list dict 性能测试
from random import randint def load_list_data(total_nums, target_nums): """ 从文件中读取数据, ...
- 利用ROS内建SLAM建立地图
ros中建地图方式有两种: 首先1.首先下载hector_slam包到你工作空间的src下 命令: cd ~/catkin/src git clone https://github.com/tu-da ...
- eclipse在linux環境下安裝注意事项
文件如果安装在非home文件夹下必须为eclipse授权 sudo chmod -R 777 /usr/tools/eclipse
- springBoot 环境
环境约束 jdk1.8:Spring Boot 推荐jdk1.7及以上:maven3.x:maven 3.3以上版本:Apache Maven 3.3.9.IntelliJIDEA2017:Intel ...
- .NET下XML文件的读写
一.前言: XML是微软.Net战略的一个重要组成部分,而且它可谓是XML Web服务的基石,所以掌握.Net框架下的XML技术自然显得非常重要了.本文将指导大家如何运用C#语言完成.Net框架下的X ...
- asp.net core 2.1 将控制器抽离到类库中
startup.cs的ConfigureServices中添加: public void ConfigureServices(IServiceCollection services) { var ma ...
- TopCoder SRM 682 Div1 Problem 450 SuccessfulMerger (环套树 + 分类讨论)
题意 给定一个$n$个点$n$条边的无向图,现在要把这个图进行若干次操作,并选择一个点作为首都. 要求除首都外的任意两个点$u$, $v$,从$u$走到$v$必须经过这个首都. 操作为合并两个相邻的 ...
- 最短Hamilton路径
题目描述 给定一张 n(n≤20) 个点的带权无向图,点从 0~n-1 标号,求起点 0 到终点 n-1 的最短Hamilton路径. Hamilton路径的定义是从 0 到 n-1 不重不漏地经过每 ...
- vue.js移动端app实战2
貌似有部分人要求写的更详细,这里多写一点vuel-cli基础的配置 什么是vue-cli? 官方的解释是:A simple CLI for scaffolding Vue.js projects,简单 ...
- 2016北京集训测试赛(十四)Problem A: 股神小L
Solution 考虑怎么卖最赚钱: 肯定是只卖不买啊(笑) 虽然说上面的想法很扯淡, 但它确实能给我们提供一种思路, 我们能不买就不买; 要买的时候就买最便宜的. 我们用一个优先队列来维护股票的价格 ...