-
Notifications
You must be signed in to change notification settings - Fork 15
Home Distance Widget
The home distance widget shows the distance between the current location of the aircraft and its home location. This widget uses the unit set in the global preferences and defaults to meters.
Images/DashboardWidgetImages/HomeDistanceWidget.gif
If creating the home 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 DUXBetaHomeDistanceWidget
. From here you can create the constraints on the container view using the Home Distance Widget's widgetSizeHint
property.
The home distance widget supports customization of its light and dark font colors.
To get this effect we would use the following code:
homeDistanceWidget.lightFontColor = UIColor.green
homeDistanceWidget.darkFontColor = UIColor.blue
homeDistanceWidget.lightFontColor = [UIColor greenColor];
homeDistanceWidget.darkFontColor = [UIColor blueColor];
List of the customizable properties
-
lightFontColor
- Font color for the home distance value, defaults to white. -
darkFontColor
- Font color for the home distance unit and name, defaults to gray.
DJI UX SDK Version 5 Beta 4.1