Android的高级控件

本文详细介绍了Android的高级控件,包括ScrollView的使用注意事项、Activity间的跳转、ProgressBar的两种进度及其应用、PopupWindow的实现及与Dialog的区别,以及Spinner的重要属性和方法。讲解了如何创建和配置这些控件,提供了具体的实现案例。
摘要由CSDN通过智能技术生成

1.ScrollView 滚动视图控件

  1. 使用时的注意点?

    1. 不用再ScrollView内部使用自带滚动条的控件或布局

    2. ScrollView直接子View只能有一个

    3. ScrollView只支持竖直滑动 如果想要横向滑动 HorizontalScrollView

  2. 如何使用?
    1. 跳转

    2. 使用

具体案例实现

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <Button
            android:id="@+id/and_di"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="滚动到底部" />

    <Button
            android:id="@+id/and_top"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="滚动到顶部" />
</LinearLayout>

<ScrollView
    android:id="@+id/sv"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="顶部"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本2"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本3"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本4"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本5"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本6"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本7"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本8"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本9"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本10"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本1"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本2"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本3"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本4"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本5"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本6"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本7"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="文本8"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            an
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值