草庐IT

expandedTitleMarginBottom

全部标签

android - 如何以编程方式为 CollapsingToolbarLayout 设置 expandedTitleMarginBottom

我们在CollapsingToolbarLayout中有一些隐藏View。因此,当我们使这些View可见时,标题的对齐方式会发生变化。所以我们需要改变expandedTitleMarginBottom的值来调整对齐方式。我们如何以编程方式为CollapsingToolbarLayout设置expandedTitleMarginBottom? 最佳答案 对于搜索此内容的任何人:您可以在collapsibleToolbarLayout上调用setExpandedTitleMarginBottom(intpx)