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

  • 相关阅读:
    Python学习(3)——if语句
    Python学习(2)——编码
    一次性邮箱
    Python学习(1)
    Hello World
    java设计模式创建篇------原型模式
    Java技巧------Cloneable接口与clone方法
    java设计模式创建篇------抽象工厂
    java设计模式创建篇------工厂模式
    python函数式编程
  • 原文地址:https://www.cnblogs.com/amosleaf/p/3225365.html
Copyright © 2011-2022 走看看