相关疑难解决方法(0)

LinearLayout不在ScrollView内扩展

我有一个LinearLayout里面ScrollViewandroid:layout_height="fill_parent",但它并没有扩展到的最大高度ScrollView.我的布局看起来像:

level    layout    layout_width    layout_height
1    LinearLayout    fill_parent    fill_parent
2    LinearLayout    fill_parent    wrap_content
3    (some irrelevant stuff)
2    ScrollView      fill_parent    fill_parent <-- this expands full height
3    LinearLayout    fill_parent    fill_parent <-- this does not (has orientation=vertical)
(following stuff probably are irrelevant, but just to be sure:)
4    TextView        fill_parent    fill_parent
4    LinearLayout    fill_parent    wrap_content
Run Code Online (Sandbox Code Playgroud)

我可以看到LinearLayout它没有扩展整个高度,ScrollView因为在Eclipse中Android Layout Editor,如果我选择ScrollView(在"大纲"面板中)它会突出显示一个红色边框,将屏幕填充到底部但是当我选择LinearLayout它的高亮显示时不会扩展到屏幕的底部.我怎么能这样做?

我想要达到的效果是在它下面有一些文字和一个按钮(在第LinearLayout4级里面只有一个按钮).文本可能足够大,需要滚动条,在这种情况下,我希望用户必须向下滚动才能看到按钮.如果文本不够大,滚动条,我希望LinearLayout包含按钮粘在屏幕的底部. …

android android-layout

362
推荐指数
4
解决办法
14万
查看次数

标签 统计

android ×1

android-layout ×1