All Products
Search
Document Center

Mobile Platform as a Service:Title bar segment component

Last Updated:Jul 19, 2023

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.

API description

    /*
     mPaaS standard: The segment controls can be used only at the top of the navigation bar.
     The default color value is used, and the default height of the navigation bar is 26 px.
     */

    #define AUTitleBarSegment_DefaultHeight             26      // The default height of each segment is 26 px.
    #define AUTitleBarSegment_DefaultSegmentWidth       90      // The default width of each segment is 90 px.

    @interface AUTitleBarSegment : UISegmentedControl

    @end

Sample code

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