Class Overview
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.
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.
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.
ScrollView only supports vertical scrolling. For horizontal scrolling, use HorizontalScrollView.
相关属性来源网络整理
android:scrollbars
设置滚动条显示。none(隐藏),horizontal(水平),vertical(垂直)。
android:scrollbarFadeDuration
设置滚动条淡出效果(从有到慢慢的变淡直至消失)时间,以毫秒为单位。Android2.2中滚动条滚动完之后会消失,再滚动又会出来,在1.5、1.6版本里面会一直显示着。
android:scrollbarSize
设置滚动条的宽度。
android:scrollbarStyle
设置滚动条的风格和位置。设置值:insideOverlay、insideInset、outsideOverlay、outsideInset
android:scrollbarThumbHorizontal
设置水平滚动条的drawable。
android:scrollbarThumbVertical
设置垂直滚动条的drawable.
android:scrollbarTrackHorizontal
设置水平滚动条背景(轨迹)的色drawable
android:soundEffectsEnabled
设置点击或触摸时是否有声音效果
传承者(Inheritors)欢迎各位纠正错误,评论,吐槽!!!