ImageView.SetMaxHeight(Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
此視野可選參數提供最大高度。
[Android.Runtime.Register("setMaxHeight", "(I)V", "GetSetMaxHeight_IHandler")]
public virtual void SetMaxHeight(int maxHeight);
[<Android.Runtime.Register("setMaxHeight", "(I)V", "GetSetMaxHeight_IHandler")>]
abstract member SetMaxHeight : int -> unit
override this.SetMaxHeight : int -> unit
參數
- maxHeight
- Int32
此視角的最大高度
- 屬性
備註
此視野可選參數提供最大高度。 只有當 #setAdjustViewBounds(boolean) 被設定為 true 時才有效。 要將影像設定為最大 100 x 100,同時保留原始長寬比,請執行以下步驟:1) 將 adjustViewBounds 設為 true 2) 將 maxWidth 和 maxHeight 設為 100 3) 將高度與寬度配置參數設為 WRAP_CONTENT。
請注意,若原始影像較小,使用此方法仍可能小於 100 x 100。 要將圖片設定為固定大小,請在版面參數中指定該尺寸,然後用來 #setScaleType(android.widget.ImageView.ScaleType) 判斷如何將圖片放入這些範圍內。
Java 文件 android.widget.ImageView.setMaxHeight(int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。