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”,同时修改线性布局控件的布局方式为垂直,即可......

  • 相关阅读:
    ES6对象展开运算符
    Vue中keep-alive的深入理解和使用
    彻底明白VUE修饰符sync
    函数去抖和函数节流
    vue cli4.0 配置环境变量
    什么是process.env?
    new Function和with
    inline-block元素没有对齐的解决方案及总结
    【译文】为什么你的浏览器会限制并发网络调用的数量?
    高德地图Marker缩放位置变化
  • 原文地址:https://www.cnblogs.com/YYkun/p/5761272.html
Copyright © 2011-2022 走看看