码迷,mamicode.com
首页 > 移动开发 > 详细

android horizontalScrollView

时间:2016-07-01 22:58:36      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:

horizontlScrollView 

java.lang.Object
   ?    android.view.View
        ?    android.view.ViewGroup
             ?    android.widget.FrameLayout
                  ?    android.widget.HorizontalScrollView

由上面的继承图,可以看出是FrameLayout的子类,它允许显示图层大于物理展示的宽度。

子view可能是一个复杂的布局, 它的子View一般是一个水平方向的LinearLayout.用来显示顶部标题

The TextView class also takes care of its own scrolling, so does not require a HorizontalScrollView, but using the two together is possible to achieve the effect of a text view within a larger container.

注意TextView需要关注自己的滚动,所以不需要使用HorizontalScrollview ,

但是也有两者在一起使用,为了达到效果,应该讲textview放在一个大的容器中。

技术分享

HorizontalScrollView中的公共方法:

  public void addView (View child)

    添加一个子视图,如果子视图没有设置属性,默认为ViewGroup的属性。

    Note: do not invoke this method from draw(android.graphics.Canvas), onDraw(android.graphics.Canvas),     dispatchDraw(android.graphics.Canvas) or any related method.

 

android horizontalScrollView

标签:

原文地址:http://www.cnblogs.com/chengbao/p/5634375.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!