androidx.appcompat.widget.Toolbar.setLayoutParams()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(108)

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

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);

相关文章