本文整理了Java中android.support.v4.widget.NestedScrollView.getLayoutParams()
方法的一些代码示例,展示了NestedScrollView.getLayoutParams()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NestedScrollView.getLayoutParams()
方法的具体详情如下:
包路径:android.support.v4.widget.NestedScrollView
类名称: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);
内容来源于网络,如有侵权,请联系作者删除!