android.support.v4.widget.NestedScrollView.getLayoutParams()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中android.support.v4.widget.NestedScrollView.getLayoutParams()方法的一些代码示例,展示了NestedScrollView.getLayoutParams()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NestedScrollView.getLayoutParams()方法的具体详情如下:
包路径:android.support.v4.widget.NestedScrollView
类名称:NestedScrollView
方法名:getLayoutParams

NestedScrollView.getLayoutParams介绍

暂无

代码示例

代码示例来源:origin: 6ag/BaoKanAndroid

@Override
  public void onGlobalLayout() {
    mCaptionTextView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
    int height = mCaptionTextView.getHeight();
    int scrollViewHeight = height + SizeUtils.dip2px(mContext, 45);
    int scrollViewMaxHeight = SizeUtils.dip2px(mContext, 120);
    // 修改文字载体ScrollView的高度 = mCaptionTextView高度 + 35dp,并且现在最大高度为200dip
    LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) mCaptionScriollView.getLayoutParams();
    layoutParams.height = scrollViewHeight < scrollViewMaxHeight ? scrollViewHeight : scrollViewMaxHeight;
    mCaptionScriollView.setLayoutParams(layoutParams);
  }
});

代码示例来源:origin: ywwynm/EverythingDone

/**
 * Set margins to {@link mScrollView}. If there is an image, marginTop will be set to 0.
 */
private void setScrollViewMarginTop(boolean hasMarginTop) {
  FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mScrollView.getLayoutParams();
  if (hasMarginTop) {
    float mt = screenDensity * 56;
    if (DeviceUtil.hasKitKatApi()) {
      mt += DisplayUtil.getStatusbarHeight(this);
    }
    params.setMargins(0, (int) mt, 0, params.bottomMargin);
  } else {
    params.setMargins(0, 0, 0, params.bottomMargin);
  }
}

代码示例来源:origin: ywwynm/EverythingDone

f(R.id.ll_bottom_bar_detail).setVisibility(View.GONE);
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams)
    mScrollView.getLayoutParams();
params.setMargins(0, params.topMargin, 0, 0);

相关文章