-
Notifications
You must be signed in to change notification settings - Fork 15
RC Distance Widget
The RC distance widget shows the distance between the current location of the aircraft and the location of the RC (pilot). This widget uses the unit set in the global preferences and defaults to meters.
Images/DashboardWidgetImages/DistanceRCWidget.gif
If creating the RC distance widget through code it can be added using the convenience method:
- (void)installInViewController:(nullable UIViewController *)viewController
which adds the widget the method is called on as a subview of the ViewController that is passed in as an argument. Following this add constraints to the widget using its widgetSizeHint
property to determine width, height and aspect ratio constraints.
If creating the widget through storyboard use the object library to drag a container view controller into the desired view controller like so:
Following this make sure to change the class of the child view controller to be DUXRCDistanceWidget
. From here you can create the constraints on the container view using the RC Distance Widget's widgetSizeHint
property.
The RC distance widget supports customization of its light and dark font colors.
To get this effect we would use the following code:
rcDistanceWidget.lightFontColor = UIColor.green
rcDistanceWidget.darkFontColor = UIColor.blue
rcDistanceWidget.lightFontColor = [UIColor greenColor];
rcDistanceWidget.darkFontColor = [UIColor blueColor];
List of the customizable properties
-
lightFontColor
- Font color for the RC distance value, defaults to white. -
darkFontColor
- Font color for the RC distance unit and name, defaults to gray.
DJI UX SDK Version 5 Beta 4.1