Skip to content

Styling

Evgenii Neumerzhitckii edited this page Jun 9, 2015 · 39 revisions

Bar styles

Bar styles describe the appearance and behaviour of the whole notification bar. One can use style.bar property for styling the notification bar. For example:

view.style.bar.locationTop = true

List of available bar styles:

  • animationHide: Specify a function for animating the bar when it is hidden. You can also use of the predefined animation functions, for example: DodoAnimations.Fade.hide.
  • animationHideDuration: Duration of hide animation. When nil it uses default duration for selected animation function.
  • animationShow: Specify a function for animating the bar when it is shown. You can also use of the predefined animation functions, for example: DodoAnimations.Fade.show.
  • animationShowDuration: Duration of show animation. When nil it uses default duration for selected animation function.
  • backgroundColor: Background color of the bar.
  • borderColor: Color of bar's border.
  • borderWidth: Border width of the bar.
  • cornerRadius: Corner radius of the bar view.
  • debugMode: When true it highlights the view background for spotting layout issues.
  • hideAfterDelaySeconds: Hides the bar automatically after the specified number of seconds. The bar is kept on screen indefinitely if the value is zero. Default value: 0.
  • hideOnTap: When true the bar is hidden when user taps on it. Default value: false.
  • locationTop: Position of the bar. When true the bar is shown on top of the screen. Default value: true.
  • marginToSuperview: Margin between the bar edge and its superview.

Button styles

Button styles describe the appearance and behaviour of one of two bar buttons. One can use style.leftButton and style.rightButton property for styling the buttons. For example:

view.dodo.style.leftButton.tintColor = DodoIcons.Close
view.dodo.style.rightButton.tintColor = DodoIcons.Reload

List of available styles:

  • accessibilityLabel: This text is spoken by the device when it is in accessibility mode. It is recommended to always set the accessibility label for your button. The text can be a short localized description of the button function, for example: "Close", "Reload" etc.
  • hideOnTap: When true it hides the bar when the button is tapped.
  • horizontalMarginToBar: Horizontal margin between the bar edge and the button.
  • icon: When set it shows one of the default Dodo icons. Use image property to supply a custom image. The color of the image can be changed with tintColor property.
  • image: Custom image for the button. One can also use the icon property to show one of the default Dodo icons. The color of the image can be changed with tintColor property.
  • onTap: Supply a function that will be called when user taps the button.
  • size: Size of the button.
  • tintColor: Replaces the color of the image or icon. The original colors are used when nil.
Clone this wiki locally