All Products
Search
Document Center

Pop menu component

Last Updated: May 25, 2021

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.

Sample image

API description

  • AUPopMenu.h

       
    1. @protocol AUPopMenuDelegate <NSObject>
    2. @optional
    3. - (void)DidClickPopItemView:(AUPopItemModel *)viewModel;
    4. @end
    5. @interface AUPopMenu : UIView
    6. @property (nonatomic, weak) id<AUPopMenuDelegate> delegate;
    7. /* datas The AUPopItemModel object list.
    8. * position The position of the direction angle.
    9. * superView The parent view.
    10. * isArchViewUp The orientation of the arrow-like corner. Default value: Down.
    11. */
    12. - (instancetype)initWithDatas:(NSArray *)datas
    13. position:(CGPoint)position
    14. superView:(UIView *)superView
    15. isArchViewUp:(BOOL)isArchViewUp;
    16. /* Show and hide the menus with animation by default.
    17. * position The start and end positions of the arrow-like corner.
    18. * superView Describe which parent view the current floating layer is displayed on.
    19. */
    20. - (void)showMenu;
    21. //
    22. - (void)hideMenu;
    23. @end
  • AUPopItemView.h

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

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

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

Sample code

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