Method Percent
Percent(float, bool)
Creates a percentage Dim object
public static Dim Percent(float n, bool r = false)
Parameters
n
floatA value between 0 and 100 representing the percentage.
r
boolIf
true
the Percent is computed based on the remaining space after the X/Y anchor positions. Iffalse
is computed based on the whole original space.
Returns
Examples
This initializes a TextFieldthat is centered horizontally, is 50% of the way down, is 30% the height, and is 80% the width of the View it added to.
var textView = new TextView () {
X = Pos.Center (),
Y = Pos.Percent (50),
Width = Dim.Percent (80),
Height = Dim.Percent (30),
};