All Products
Search
Document Center

Title bar segment component

Last Updated: May 18, 2021

AUTitleBarSegment is a segmented control used at the top of the navigation bar. AUTitleBarSegment encapsulates UISegmentedControl, simply modifies the UI style of UISegmentedControl, and provides default width and height of each segment.

Sample image

navbar

API description

 
  1. /*
  2. mPaaS standard: The segment controls can be used only at the top of the navigation bar.
  3. The default color value is used, and the default height of the navigation bar is 26 px.
  4. */
  5. #define AUTitleBarSegment_DefaultHeight 26 // The default height of each segment is 26 px.
  6. #define AUTitleBarSegment_DefaultSegmentWidth 90 // The default width of each segment is 90 px.
  7. @interface AUTitleBarSegment : UISegmentedControl
  8. @end

Sample code

 
  1. AUTitleBarSegment *titleBatSegment = [[AUTitleBarSegment alloc] initWithItems:@[@"Label", @"Label"]];
  2. self.navigationItem.titleView = titleBatSegment;