Class
MobileRectangle
Description
The standard rectangle control for iOS.
Properties
Name |
Type |
Read-Only |
Shared |
---|---|---|---|
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
|||
✓ |
Methods
Name |
Parameters |
Returns |
Shared |
---|---|---|---|
constraint As iOSLayoutConstraint |
|||
child As MobileUIControl |
|||
index As Integer |
|||
constraint As iOSLayoutConstraint |
|||
child As MobileUIControl |
|||
blurStyle As BlurStyles, vibrancyStyle As VibrancyStyles = VibrancyStyles.None, vibrantContent As MobileContainer = Nil |
|||
Enumerations
MobileRectangle.BlurStyles
BlurStyles
BlurStyles The type of blur to apply.
Enum |
Description |
---|---|
ExtraLight |
The area of the view is lighter in hue than the underlying view. |
Light |
The area of the view is the same approximate hue of the underlying view. |
Dark |
The area of the view is darker in hue than the underlying view. |
ExtraDark |
The area of the view is even more dark in hue than the underlying view. |
Regular |
A regular blur style that adapts to the user interface style. |
Prominent |
A blur style for making content more prominent that adapts to the user interface style. |
UltraThinMaterial |
An adaptable blur effect that creates the appearance of an ultra-thin material. |
ThisMaterial |
An adaptable blur effect that creates the appearance of a thin material. |
Material |
An adaptable blur effect that creates the appearance of a material with normal thickness. |
ThickMaterial |
An adaptable blur effect that creates the appearance of a material that is thicker than normal. |
ChromeMaterial |
An adaptable blur effect that creates the appearance of the system chrome. |
UltraThinMaterialLight |
A blur effect that creates the appearance of an ultra-thin material and is always light. |
ThinMaterialLight |
A blur effect that creates the appearance of a thin material and is always light. |
MaterialLight |
A blur effect that creates the appearance of a material with normal thickness and is always light. |
ThickMaterialLight |
A blur effect that creates the appearance of a material that is thicker than normal and is always light. |
ChromeMaterialLight |
A blur effect that creates the appearance of the system chrome and is always light. |
UltraThinMaterialDark |
A blur effect that creates the appearance of an ultra-thin material and is always dark. |
ThinMaterialDark |
A blur effect that creates the appearance of a thin material and is always dark. |
MaterialDark |
A blur effect that creates the appearance of a material with normal thickness and is always dark. |
ThickMaterialDark |
A blur effect that creates the appearance of a material that is thicker than normal and is always dark. |
ChromeMaterialDark |
A blur effect that creates the appearance of the system chrome and is always dark. |
MobileRectangle.VibrancyStyles
VibrancyStyles
VibrancyStyles The type of vibrancy to apply.
Enum |
Description |
---|---|
None |
No vibrancy. |
Label |
A style for labels containing primary content. |
SecondaryLabel |
A style for labels containing secondary content. |
TertiaryLabel |
A style for labels containing tertiary content. |
QuaternaryLabel |
A style for labels containing quaternary content. |
Fill |
A style for views with large filled areas containing primary content. |
SecondaryFill |
A style for views with large filled areas containing secondary content. |
TertiaryFill |
A style for views with large filled areas containing tertiary content. |
Separator |
A style for separator lines. |
Property descriptions
MobileRectangle.AccessibilityHint
AccessibilityHint As String
The accessibility hint is a longer description that is read aloud when VoiceOver is enabled.
Me.AccessibilityHint = "Click to calculate the value and display the next screen."
MobileRectangle.AccessibilityLabel
AccessibilityLabel As String
The accessibility label of of a control is a short name that is read aloud when VoiceOver is enabled.
Me.AccessibilityLabel = "Calculate the value."
MobileRectangle.BorderColor
BorderColor As ColorGroup
The color of the border.
MobileRectangle.BorderThickness
BorderThickness As Double
The thickness of the border in points.
MobileRectangle.ControlCount
ControlCount As Integer
The number of child controls in the control.
This property is read-only.
MobileRectangle.CornerSize
CornerSize As Double
The size of the corner in points. Used to create rounded corners.
Round the corners:
Rectangle1.CornerSize = 25
MobileRectangle.Enabled
Enabled As Boolean
Indicates whether the control is enabled or disabled.
Disable the button:
Button1.Enabled = False
MobileRectangle.FillColor
FillColor As ColorGroup
The fill color.
MobileRectangle.Height
Height As Double
The height of the control.
This property is read-only.
MobileRectangle.Left
Left As Double
The left position of the control.
This property is read-only.
MobileRectangle.Name
Name As String
The name of the control.
MobileRectangle.Parent
Parent As MobileUIControl
The parent (sometimes called a "Super") class of the control.
This property is read-only.
MobileRectangle.TintColor
TintColor As ColorGroup
Changes a control's tint color.
On iOS, the following controls support TintColor:
Enum |
Description |
---|---|
ProgressBar |
The area indicating the value of the control will be drawn in the TintColor. |
Slider |
The area indicating the value of the control will be drawn in the TintColor. |
TextArea |
The cursor and text highlight color will be drawn in the TintColor. |
TextField |
The cursor and text highlight color will be drawn in the TintColor. |
MobileRectangle.Top
Top As Double
The top position of the control.
This property is read-only.
MobileRectangle.Visible
Visible As Boolean
Indicates whether the control is visible.
Make a button invisible:
Button1.Visible = False
MobileRectangle.Width
Width As Double
The width of the control.
This property is read-only.
Method descriptions
MobileRectangle.AddConstraint
AddConstraint(constraint As iOSLayoutConstraint)
Adds a constraint to the control.
This constraint is used by child controls that have been added to this control.
MobileRectangle.AddControl
AddControl(child As MobileUIControl)
Adds a child control to the control.
MobileRectangle.ClearFocus
ClearFocus
Removes the focus from the control.
TextField1.ClearFocus
MobileRectangle.ControlAt
ControlAt(index As Integer) As MobileUIControl
Gets the child control at the specified index.
MobileRectangle.Controls
Controls As Iterable
Allows you to iterate through all the controls that have been added to this control.
MobileRectangle.Handle
Handle As Ptr
The a handle to the underlying native OS control.
MobileRectangle.Refresh
Refresh
Marks the control so that it will be redrawn during the next event loop.
Call Refresh to force a Canvas to redraw itself:
Canvas1.Refresh
MobileRectangle.RemoveConstraint
RemoveConstraint(constraint As iOSLayoutConstraint)
Removes a constraint from the control.
MobileRectangle.RemoveControl
RemoveControl(child As MobileUIControl)
Removes the control from the control.
MobileRectangle.SetEffect
SetEffect(blurStyle As BlurStyles, vibrancyStyle As VibrancyStyles = VibrancyStyles.None, vibrantContent As MobileContainer = Nil)
Sets the blur effect for the rectangle.
blurStyle as MobileRectangle.BlurStyles - The type of blur. The BlurStyles enum defines 21 different styles, the first 6 work on all supported versions of iOS (10-13) styles 7-21 were introduced with iOS 13 and will only work on those devices.
vibrancyStyle as MobileRectangle.VibrancyStyles - Specifies the type of vibrancy you'd like to use with this rectangle. iOS 10-12 support two of the eight styles (Label and Fill) whereas iOS 13 supports all eight styles.
vibrancyContent as iOSContainer - the content that you'd like to have exhibit vibrancy within the rectangle.
In order for the effect to take place, the background color of the parent view must to be set to clear. For example: ParentRectangle.FillColor = Color.Clear
MobileRectangle.SetFocus
SetFocus
Sets the focus to the control.
TextField1.SetFocus
Event descriptions
MobileRectangle.Closing
Closing
Called when the control's layout is closing.
MobileRectangle.Opening
Opening
Called when the control's layout is opening.
This is where you typically put initialization code.
This example in the Opening event of a label sets its text to "Hello":
Me.Text = "Hello"
Sample code
Sample Code In the Opening event handler, update the rectangle to have thick blue borders, rounded corners and a red fill:
Me.BorderColor = Color.Blue
Me.BorderThickness = 10
Me.CornerSize = 25
Me.FillColor = Color.Red
Compatibility
Mobile projects on all supported mobile operating systems.