zoukankan      html  css  js  c++  java
  • android学习笔记11——ScrollView

    ScrollView——滚动条

    用于内容显示不全,可提供滚动条下来形式,显示其余内容。

    ScrollView和HorizontalScrollView是为控件或者布局添加滚动条

    特点如下:

      1.只能有一个子控件

      2.两个控件可以互相嵌套

      3.ScrollView派生子FrameLayout

      4.ScrollView——垂直滚动条;HorizontalScrollView——水平滚动条

      5.属性scrollbars 可以设置滚动条的方向:但ScrollView设置为horizontal/none效果相同,HorizontalScrollView设置为vertical和none的效果相同

    实例如下:

    <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity" >
    
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >
    
            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="0001" />
    
            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="0001" />
    
        //足够多控件
         .......
    
    
    </HorizontalScrollView>
    

    允许效果:略

    需要看ScrollView效果需将布局文件内容跟标签更改为“ScrollView”,同时修改线性布局控件的布局方式为垂直,即可......

  • 相关阅读:
    每日日报
    HTML相关
    60-Shiro功能扩展(记住我)
    60--Shiro安全框架
    服务器项目部署简单操作
    61--DB项目--修改密码模块设计
    59-SpringAOP --Cache操作(注解)
    58-Spring AOP 异步操作
    58-Spring-AOP事务管理
    Terminal 执行 java 命令
  • 原文地址:https://www.cnblogs.com/YYkun/p/5761272.html
Copyright © 2011-2022 走看看