Open wl532882877 opened 2 years ago
使用View的padding应该可以
使用View的padding应该可以
你好可不可以详细说明一下, 比如我现在在一个LinearLayout (orientation="vertical")里面写了一个 GysoTreeView(高度和宽度是自适应的),然后下面还有很多控件,但是GysoTreeView占的高度太高了,导致和下一个控件之间有一块很大的空白,这个空白就是 GysoTreeView的高度,能否有地方去设置GysoTreeView的总体高度呢
使用View的padding应该可以
你好可不可以详细说明一下, 比如我现在在一个LinearLayout (orientation="vertical")里面写了一个 GysoTreeView(高度和宽度是自适应的),然后下面还有很多控件,但是GysoTreeView占的高度太高了,导致和下一个控件之间有一块很大的空白,这个空白就是 GysoTreeView的高度,能否有地方去设置GysoTreeView的总体高度呢
在TreeViewContainer的onMeasure里ViewBox viewBox = mTreeLayoutManager.getTreeLayoutBox();
为计算获得的树状图宽高,你可以在onMeasure里修改适应。 其中是这里生效
int specWidth = MeasureSpec.makeMeasureSpec(Math.max(winWidth, viewBox.getWidth()), MeasureSpec.EXACTLY);
int specHeight = MeasureSpec.makeMeasureSpec(Math.max(winHeight,viewBox.getHeight()),MeasureSpec.EXACTLY);
整个树状图 上下的距离可以设置高度吗