Android7.0中文文档(API) -- ScrollView

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/ScrollView.html

ScrollView

public class ScrollView
extends FrameLayout

java.lang.Object
   ↳android.view.View
    ↳android.view.ViewGroup
     ↳android.widget.FrameLayout
      ↳android.widget.ScrollView


Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display. A ScrollView is a FrameLayout, meaning you should place one child in it containing the entire contents to scroll; this child may itself be a layout manager with a complex hierarchy of objects. A child that is often used is a LinearLayout in a vertical orientation, presenting a vertical array of top-level items that the user can scroll through.
视图层次结构的布局容器,可以由用户进行滚动,允许它的内容比物理显示屏更大。ScrollView是一个FrameLayout,这意味着你应该在其中放置一个子项来滚动,其包含了所有的内容;这个子项本身可能是一个具有复杂的对象层次结构的布局管理器。子项经常在垂直方位中,使用一个LinearLayout,其呈现了一个顶层项的垂直排列,用户可以滚动浏览。

You should never use a ScrollView with a ListView, because ListView takes care of its own vertical scrolling. Most importantly, doing this defeats all of the important optimizations in ListView for dealing with large lists, since it effectively forces the ListView to display its entire list of items to fill up the infinite container supplied by ScrollView.
你不能将ScrollView和ListView一起使用,因为ListView负责自己的垂直滚动操作。最重要的是,这样做会破坏ListView中为处理大型列表所有重要的优化,因为它有效地迫使ListView显示它的整个列表,以填充由ScrollView提供的无限容器。

The TextView class also takes care of its own scrolling, so does not require a ScrollView, but using the two together is possible to achieve the effect of a text view within a larger container.
TextView类也负责它自己的滚动,因此不需要ScrollView,但是同时使用,可以实现在较大容器中的显示文本视图的效果。

ScrollView only supports vertical scrolling. For horizontal scrolling, use HorizontalScrollView.
ScrollView仅支持垂直滚动。关于水平滚动,请使用HorizontalScrollView

摘要


XML属性

android:fillViewport设置scrollview是否应拉伸其内容以填充可视区域。 

继承XML属性

From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View

继承常量

From class android.view.ViewGroup
From class android.view.View

继承字段

From class android.view.View

Public构造方法

ScrollView(Context context)
ScrollView(Context context, AttributeSet attrs)
ScrollView(Context context, AttributeSet attrs, int defStyleAttr)
ScrollView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public方法

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/ScrollView.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值