zoukankan      html  css  js  c++  java
  • LinearLayout 滚动条

    比如文件列表, 显示不下,需要出滚动条:外面加一个scrollview

    直接上代码:

    <?xml version="1.0" encoding="utf-8"?>
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:fadingEdge="vertical"
        android:scrollbars="vertical" >
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >
    
            <ImageView
                android:id="@+id/imageThumb"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="2dp"
                android:layout_weight="3" />
    
            <TextView
                android:id="@+id/imagePath"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="2sp"
                android:layout_weight="6"
                android:textColor="#FF00FF"
                android:textSize="20sp" />
    
            <CheckBox
                android:id="@+id/checkBox1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="2sp"
                android:layout_weight="1" />
        </LinearLayout>
    
    </ScrollView>

    既然可以水平滚动, 那也可以垂直滚动。外面加 HorizontalScrollView

  • 相关阅读:
    数字精确运算BigDecimal经常用法
    C3P0数据库连接池使用
    Theano学习笔记(四)——导数
    Leetcode--Merge Intervals
    1191 数轴染色
    P1021 邮票面值设计
    P1032 字串变换
    P1294 高手去散步
    P1832 A+B Problem(再升级)
    P1332 血色先锋队
  • 原文地址:https://www.cnblogs.com/amosleaf/p/3225365.html
Copyright © 2011-2022 走看看