如何使一个线性布局滚动? [英] How to make a linear layout scrollable?
问题描述
嘿 - 这可能使整个线性布局滚动时,它需要是什么? (当所有在布局的元素不适合在主屏幕上)?
Hey all - is it possible to make an entire linear layout scrollable when it needs to be? (when all of the elements in the layout don't fit on the main screen)?
我知道它是可行的,可欣赏,等...但有一种将一切的布局是滚动在同一时间?
I know it is doable with views, etc...but is there a way to incorporate everything on the layout to be scrollable at the same time?
也许滚动是不正确的术语...基本上 - 如果所述元件中的一个(在此情况下,一个按钮)不完全使其到手机的主屏幕和我需要向下滑动手指来访问它...如果是有道理的。
Maybe scrollable is not the right term...basically - if one of the elements (a button in this case) doesn't entirely make it onto the main screen of the phone and I need to slide a finger down to access it...if that makes sense.
推荐答案
一个的LinearLayout是View的子类,所以任何你可以用一个视图中,可以用线性布局做的。
A LinearLayout is a subclass of View, so anything you can do with a View you can with a Linear Layout.
因此,只要使用滚动型与单个的LinearLayout作为一个孩子
So just use ScrollView with a single LinearLayout as a child
这篇关于如何使一个线性布局滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!