本文整理了Java中androidx.appcompat.widget.Toolbar.setLayoutParams()
方法的一些代码示例,展示了Toolbar.setLayoutParams()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Toolbar.setLayoutParams()
方法的具体详情如下:
包路径:androidx.appcompat.widget.Toolbar
类名称:Toolbar
方法名:setLayoutParams
暂无
代码示例来源:origin: niorgai/StatusBarCompat
int statusBarHeight = getStatusBarHeight(activity);
lp.height += statusBarHeight;
toolbar.setLayoutParams(lp);
toolbar.setPadding(toolbar.getPaddingLeft(), toolbar.getPaddingTop() + statusBarHeight, toolbar.getPaddingRight(), toolbar.getPaddingBottom());
toolbar.setTag(true);
代码示例来源:origin: niorgai/StatusBarCompat
int statusBarHeight = getStatusBarHeight(activity);
lp.height += statusBarHeight;
toolbar.setLayoutParams(lp);
toolbar.setPadding(toolbar.getPaddingLeft(), toolbar.getPaddingTop() + statusBarHeight, toolbar.getPaddingRight(), toolbar.getPaddingBottom());
toolbar.setTag(true);
代码示例来源:origin: pranavpandey/dynamic-support
/**
* Set layout scroll flags for the toolbar.
* <p>Useful to change the collapse mode dynamically.
*
* @param flags The scroll flags for the collapsing toolbar layout.
*/
public void setToolbarLayoutFlags(@AppBarLayout.LayoutParams.ScrollFlags int flags) {
if (mToolbar != null) {
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams)
mToolbar.getLayoutParams();
params.setScrollFlags(flags);
mToolbar.setLayoutParams(params);
}
}
代码示例来源:origin: MCMrARM/revolution-irc
AppBarLayout.LayoutParams toolbarParams = new AppBarLayout.LayoutParams(
AppBarLayout.LayoutParams.MATCH_PARENT, params.height);
replacement.setLayoutParams(toolbarParams);
for (int j = 0; j < mToolbar.getChildCount(); j++) {
View v = mToolbar.getChildAt(j);
内容来源于网络,如有侵权,请联系作者删除!