Android 之 ScrollView(垂直滑动)组件
16lz
2021-01-23
ScrollView 组件测试:
使用注意事项:1、必须设定宽度和高度
2、该组件里面只能包含一个子元素;(例如单一的布局组件)
测试代码如下:
使用注意事项:1、必须设定宽度和高度
2、该组件里面只能包含一个子元素;(例如单一的布局组件)
测试代码如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <!-- 垂直方向测试 --> <ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content" > <!-- 水平方向测试 --> <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:text=".........................................................................................." /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:text="hellow2" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:text="hellow" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:text="hellow" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:text="hellow" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="80dp" android:text="hellow" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="80dp" android:text="hellow" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="80dp" android:text="hellow" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="80dp" android:text="HI!!!!" /> </LinearLayout> </HorizontalScrollView> </ScrollView></LinearLayout>
更多相关文章
- 使用命令行在手机上运行android单元测试
- Android引用百度定位API第三方组件后导致其它.so文件无法正常加
- Android 桌面组件
- Android图形库Skia(一)-基本测试生成PNG图片
- 组件化实践记录——在library module的manifest中使用applicatio
- Android软件测试的日志文件抓取简介
- 程序的组件模式
- Android手机访问Django测试服务器方法