`
1140566087
  • 浏览: 550990 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
博客专栏
2c4ae07c-10c2-3bb0-a106-d91fe0a10f37
c/c++ 入门笔记
浏览量:18183
3161ba8d-c410-3ef9-871c-3e48524c5263
Android 学习笔记
浏览量:310772
Group-logo
J2ME 基础学习课程集
浏览量:18230
A98a97d4-eb03-3faf-af96-c7c28f709feb
Spring 学习过程记录...
浏览量:17307
社区版块
存档分类
最新评论

Android 之 ScrollView(垂直滑动)组件

阅读更多
ScrollView 组件测试:
使用注意事项: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>
  • 大小: 30.4 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics