Android 底部零件不使用scrollview以线性布局显示
我有线性布局,但底部部分不显示,如果滚动数据大于屏幕大小 在线性布局内使用Scrollview时,当滚动数据超过设备高度时,搜索底部零件。 若我的数据少于垂直屏幕大小,那个么底部的所有按钮都会正确显示Android 底部零件不使用scrollview以线性布局显示,android,scrollview,Android,Scrollview,我有线性布局,但底部部分不显示,如果滚动数据大于屏幕大小 在线性布局内使用Scrollview时,当滚动数据超过设备高度时,搜索底部零件。 若我的数据少于垂直屏幕大小,那个么底部的所有按钮都会正确显示 public class TestGUI extends LinearLayout { sv = new ScrollView(context); hsv = new HorizontalScrollView(context); this.ad
public class TestGUI extends LinearLayout {
sv = new ScrollView(context);
hsv = new HorizontalScrollView(context);
this.addView(topLinearHorizonal);
hsv.addView(tableLayout);
sv.addView(hsv);
this.addView(sv);
this.addView(fullbottomLinearHorizonal);
}
编辑:
LinearLayout fullbottomLinearHorizonal= new LinearLayout(context);
fullbottomLinearHorizonal.setOrientation(VERTICAL);
fullbottomLinearHorizonal.addView(clearLinearHorizonal);
fullbottomLinearHorizonal.addView(bottomLinearHorizonal);
如果要始终在底部(可见)显示
fullbottomLinearHorizonal
,您可以在向TestGUI添加视图时尝试以下操作:
LinearLayout.LayoutParams svParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 0, 1);
this.addView(sv, svParams);
LinearLayout.LayoutParams fullbottomParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, WRAP_CONTENT);
this.addView(fullbottomLinearHorizonal, fullbottomParams);
this.setOrientation(VERTICAL);
编辑:线性布局的默认方向也是水平的。
您最好将其设置为垂直于TestGUI
:
LinearLayout.LayoutParams svParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 0, 1);
this.addView(sv, svParams);
LinearLayout.LayoutParams fullbottomParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, WRAP_CONTENT);
this.addView(fullbottomLinearHorizonal, fullbottomParams);
this.setOrientation(VERTICAL);
如果要在滚动内容的末尾添加fullbottomLinearHorizonal
,则必须将其添加到滚动视图中。您的滚动视图是父布局吗?否,我的父布局中有linearlayour。内部线性布局滚动视图集。此.addView(fullbottomlinearhorizonal);在我的情况下是有弹性的。首先,日期在ok。如果我有更多的垂直数据,那么屏幕上就会出现。FullBottomLinearHolization是一个线性布局吗?是的。我有一个问题,请检查我编辑的问题。