【发布时间】:2010-11-15 11:19:03
【问题描述】:
如何在 Android 中显示具有以下配置的图像?
- 保留原始纵横比(图片可以缩放,但不能拉伸)
- 填充父级宽度
- 与父级底部对齐
以下不起作用:
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:layout_alignParentBottom="true"
android:src="@drawable/background" />
使用上面的 xml,ImageView 采用父级的宽度,但 ImageView 内的图像没有。
【问题讨论】:
-
如果您也能告诉我们什么不起作用会有所帮助吗?
标签: android imageview android-layout resolution-independence