android – CollapsingToolbarLayout with Image,固定宽高比

android – CollapsingToolbarLayout with Image,固定宽高比,第1张

概述我在CollapsingToolbarLayout中有一个图像(与示例 https://github.com/chrisbanes/cheesesquare相同). 但是,我想将背景的宽高比固定为16:9. 我尝试设置android:layout_height =“wrap_content”,更新代码中的LayoutParams,但它不起作用. 有帮助吗? 通过将ImageView放在Percen 我在CollapsingToolbarLayout中有一个图像(与示例 https://github.com/chrisbanes/cheesesquare相同).

但是,我想将背景的宽高比固定为16:9.

我尝试设置androID:layout_height =“wrap_content”,更新代码中的LayoutParams,但它不起作用.

有帮助吗?

解决方法 通过将ImageVIEw放在PercentrelativeLayout中解决. 总结

以上是内存溢出为你收集整理的android – CollapsingToolbarLayout with Image,固定宽高比全部内容,希望文章能够帮你解决android – CollapsingToolbarLayout with Image,固定宽高比所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1135619.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存