All Products
Search
Document Center

Mobile Platform as a Service:Pop menu component

Last Updated:Jul 19, 2023

The AUPopMenu component provides popping-up menus when the user clicks the navigation bar tabs.

  • Different from AUFloatMenu, AUPopMenu has menu outlines but no bottom masks. All menus are aligned in the center. The separation lines have a fixed length and are aligned in the center.

  • Basic functions: Menus in this dialog box popping out upwards or downwards, the popping positions are all defined by the business needs.

API description

  • AUPopMenu.h

     @protocol AUPopMenuDelegate <NSObject>
    
      @optional
      - (void)DidClickPopItemView:(AUPopItemModel *)viewModel;
    
      @end
    
      @interface AUPopMenu : UIView
    
      @property (nonatomic, weak) id<AUPopMenuDelegate> delegate;
    
      /*  datas           The AUPopItemModel object list.
       *  position        The position of the direction angle.
       *  superView       The parent view.
       *  isArchViewUp    The orientation of the arrow-like corner. Default value: Down.
       */
      - (instancetype)initWithDatas:(NSArray *)datas
                           position:(CGPoint)position
                          superView:(UIView *)superView
                       isArchViewUp:(BOOL)isArchViewUp;
    
      /* Show and hide the menus with animation by default.
       *  position The start and end positions of the arrow-like corner.
       *  superView Describe which parent view the current floating layer is displayed on.
       */
      - (void)showMenu;
    
      //
      - (void)hideMenu;
    
      @end
  • AUPopItemView.h

     @interface AUPopItemView : AUPopItemBaseView
    
      @property (nonatomic, strong) AUIconView *iconView;   // Support the icon font image.
      //@property (nonatomic, strong) UIView *badgeView     // The badge is not supported currently.
    
      - (instancetype)initWithModel:(AUPopItemModel *)model position:(CGPoint )position;
    
      @end
  • AUPopItemBaseView.h

     //
      @interface AUPopItemBaseView : UIControl
    
      @property (nonatomic, strong) AULabel *titleLabel; //
    
      @end
  • AUPopItemModel.h

     // The object model.
      @interface AUPopItemModel : NSObject
    
      @property (nonatomic, strong) NSString *titleString;    // The main description.
      @property (nonatomic, strong) id iconImage;             // The left-side icon, which can be a UIImage object or URL.
    
      @end

Sample code

_menu = [[AUPopMenu alloc] initWithDatas:array position:CGPointMake(CGRectGetMidX(button.frame), CGRectGetMaxY(button.frame)+5) superView:self.view isArchViewUp:YES];
_menu.delegate = self;
[_menu showMenu];