【发布时间】:2015-08-06 11:21:51
【问题描述】:
我想在我的应用程序中设置一个背景图像,如果需要,它将填充所有屏幕和缩放,所以我在 main_layout.xml 中设置它:
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:id="@+id/imageView"
android:src="@drawable/bg_iphone_6_plus" />
它看起来像这样
不太好,其实我也需要这张图调整宽度。
好的,所以这在大多数情况下都适用,并且所有 API 都高于 16,但是当我在 api 低于 16 ( minTargetSdk=14 ) 上运行我的应用程序时,我看到了:
我不知道为什么会这样,我已经尝试过tutorial,并将 ImageView 替换为 com.inthecheesefactory.thecheeselibrary.widget.AdjustableImageView
但它并没有改变任何东西
【问题讨论】:
标签: android android-layout imageview adjustment