android *** Layout 13 ScrollView

ScrollView是一个提供滚动功能的布局,内部通常包含一个LinearLayout。它限制只能有一个直接子视图,其他内容需放入LinearLayout中。XML布局中可以直接添加元素,但若需动态更新内容,可通过LinearLayout的addView方法。示例中还提及了ProgressDialog的使用,用于展示和关闭对话框。
摘要由CSDN通过智能技术生成

http://android-doc.com/reference/android/widget/ScrollView.html

网址如下,ScrollView视图主要是给用户一个滚动的窗口,然后ScrollView里面只有一个LinearLayout的 布局,且只能有这一个,其余其他的内容只能在linearLayout里面添加。

再有就是可以直接在xml下的文件里给linearLayout添加元素,这样的话就导致所有的内容都是死的,已经固定了。同时也可以在linearLayout里面通过.addView来添加内容,以此来得到实时的更新。

其xml文件如下

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:android1="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="${relativePackage}.${activityClass}" >

    <ScrollView
        android1:id="@+id/scrollView1"
        android1:layout_width="wrap_content"
        android1:layout_height="wrap_content"
        android1:layout_alignParentLeft="true"
        android1:layout_alignParentRight="true"
        android1:layout_alignParentTop="true" >

        <LinearLayout
       		android1:id="@+id/line"
            android1:layout_width="match_parent"
            android1:layout_height="wrap_content"
            android1:orientation="vertical" &
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值