【发布时间】:2017-10-06 18:30:52
【问题描述】:
我对 XML 和 Android Studio 还很陌生,但属性“wrap_content”不应该将自己包裹在图像周围吗? 使用此代码,ImageView 看起来像这样ImageView bigger than image
<ImageView
android:id="@+id/slika"
android:src="@drawable/kava"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:adjustViewBounds="false" />
如果我将 adjustViewBounds 更改为“true”,它看起来不错,但在纵向模式下会搞砸一切。 Like this
【问题讨论】:
-
你发现了吗?
-
你也可以试试
android:scaleType="centerInside"和android:scaleType="centerCrop"。如果你不希望你的图像被裁剪,你也可以试试这个android:adjustViewBounds="true"android:layout_centerInParent="true"
标签: xml android-studio android-studio-2.3