共用方式為


PopupWindow.Width Property

Definition

Returns the popup's requested width. -or- Sets the popup's requested width.

public virtual int Width { [Android.Runtime.Register("getWidth", "()I", "GetGetWidthHandler")] get; [Android.Runtime.Register("setWidth", "(I)V", "GetSetWidth_IHandler")] set; }
[<get: Android.Runtime.Register("getWidth", "()I", "GetGetWidthHandler")>]
[<set: Android.Runtime.Register("setWidth", "(I)V", "GetSetWidth_IHandler")>]
member this.Width : int with get, set

Property Value

the popup width in pixels or a layout constant

Attributes

Remarks

Property getter documentation:

Returns the popup's requested width. May be a layout constant such as LayoutParams#WRAP_CONTENT or LayoutParams#MATCH_PARENT.

The actual size of the popup may depend on other factors such as clipping and window layout.

Java documentation for android.widget.PopupWindow.getWidth().

Property setter documentation:

Sets the popup's requested width. May be a layout constant such as LayoutParams#WRAP_CONTENT or LayoutParams#MATCH_PARENT.

The actual size of the popup may depend on other factors such as clipping and window layout.

If the popup is showing, calling this method will take effect the next time the popup is shown.

Java documentation for android.widget.PopupWindow.setWidth(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also