Difference between revisions of "iOSUserControl"

From Xojo Documentation

(Created page with "{{ClassBox | super=iOSControl | project=Mobile | target=iOS | scope=global }} {{Description | text=Used to embed UIViews created via declares into the Xojo control hierarc...")
 
 
Line 9: Line 9:
  
 
<dynamictable id="Events" super="iOSControl" class="eventTable" title="Events" columns="3">
 
<dynamictable id="Events" super="iOSControl" class="eventTable" title="Events" columns="3">
 +
{{Event | name=AppearanceChanged | description=AppearanceChanged(dark As Boolean)&#10;Called when iOS has switched between light and dark modes.}}
 
{{Event | name=CreateView | description=CreateView&#10;Use this event to create the UIView to use for the control. Return the pointer to the UIView.}}
 
{{Event | name=CreateView | description=CreateView&#10;Use this event to create the UIView to use for the control. Return the pointer to the UIView.}}
 
</dynamictable>
 
</dynamictable>

Latest revision as of 16:27, 26 May 2020

Class (inherits from iOSControl)

Used to embed UIViews created via declares into the Xojo control hierarchy.

Events
AppearanceChanged CreateView
Close Open
Properties
AccessibilityHint Left fa-lock-32.png Top fa-lock-32.png
AccessibilityLabel Name fa-lock-32.png Visible
Height fa-lock-32.png Parent fa-lock-32.png Width fa-lock-32.png
Methods
AddConstraint ControlCount RemoveConstraint
AddControl Handle RemoveControl
Control Invalidate SetTintColor

Notes

Each iOSControl has an underlying UIView. The iOSUserControl class lets you hand the framework explicitly what you want it to use for the UIView.

In the CreateView event, you should create and configure whatever UIView you want. If the UIView's initializer requires a frame rectangle, pass in anything arbitrary (it will be placed correctly via auto layout). The UIView should be returned autoreleased and not just the result of alloc+init.

You cannot place an iOSUserControl (from the Library) directly on a layout. Instead you must subclass it, add code to the CreateView event handler and then drag the subclass onto the layout.

See Also

Declare