語言

ImageView.SetAdjustViewBounds(Boolean) 方法

定義

如果你想讓 ImageView 調整其邊界以維持可繪製物件的長寬比,請將此設定為 true。

[Android.Runtime.Register("setAdjustViewBounds", "(Z)V", "GetSetAdjustViewBounds_ZHandler")]
public virtual void SetAdjustViewBounds(bool adjustViewBounds);
[<Android.Runtime.Register("setAdjustViewBounds", "(Z)V", "GetSetAdjustViewBounds_ZHandler")>]
abstract member SetAdjustViewBounds : bool -> unit
override this.SetAdjustViewBounds : bool -> unit

參數

adjustViewBounds
Boolean

是否調整此視角的邊界以保留原始可繪圖的寬高比。

屬性

備註

如果你想讓 ImageView 調整其邊界以維持可繪製物件的長寬比,請將此設定為 true。

<strong>Note:</strong> 如果應用程式目標為 API 等級 17 或更低,adjustViewBounds 將允許可繪製物件縮小視圖邊界,但不會在所有情況下都擴大以填滿可用測量空間。 這是為了與傳承 android.view.View.MeasureSpec MeasureSpec 系統和 android.widget.RelativeLayout RelativeLayout 行為相容性。

Java 文件 android.widget.ImageView.setAdjustViewBounds(boolean)

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

另請參閱