如何将底表窥视高度设置为视图下方?

时间:2019-11-15 05:06:36

标签: java android

我在bottomsheet behavior中有一个linear layout。我需要将peak height中的bottom sheet设置为低于此button,因此它在所有屏幕上都可以正常工作,而不是提供恒定的值。

bottom sheetCoordinatorLayout内部,该空间具有怪异的透明大空间。我想让床单填满那个空间
圆角的底页peak height应该与Fireworks文本下方匹配

我尝试使用setPeekHeight(ContainerOfBottomSheet.getMeasuredHeight());,但它似乎返回0或一个非常大的值。 我该怎么办?

更新
这是我的代码:

private void SettingSheet(LinearLayout sheet, final CoordinatorLayout c) {
  final BottomSheetBehavior beh = BottomSheetBehavior.from(sheet);

  c.measure(ActionBar.LayoutParams.WRAP_CONTENT, ActionBar.LayoutParams.WRAP_CONTENT);
  CHeight = c.getMeasuredHeight();

  beh.setPeekHeight(CHeight);
        }

//This is making the big value i have talked about

0 个答案:

没有答案