ImageView 有 android:adjustViewBounds
這個屬性,原文檔說明為
Set this to true if you want the ImageView
to adjust its bounds to preserve the aspect ratio of its drawable. [boolean]
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:background="#666666"
android:src="@drawable/ic_launcher" />
沒有留言:
張貼留言