右边菜单中的按键,点击弹出一个列表可选择,选择其中一个,响应相应的事件并把文字显示在右边的菜单上;弹出下拉效果使用LMDropdownView插件,可以用POD进行加载pod ‘LMDropdownView’;LMDropdownView是 ...
右边菜单中的按键,点击弹出一个列表可选择,选择其中一个,响应相应的事件并把文字显示在右边的菜单上;弹出下拉效果使用LMDropdownView插件,可以用POD进行加载pod ‘LMDropdownView’;LMDropdownView是把想要的视图赋给它;
源代码地址:https://github.com/JxbSir/YiYuanYunGou
效果如下:
1:在主页面先定义按键跟绑定视图(没写全的都是属性中定义了比如btnRigth,dropdownView等):
btnRigth = [UIButton buttonWithType:UIButtonTypeCustom]; [btnRigth addTarget:self action:@selector(btnRightAction) forControlEvents:UIControlEventTouchUpInside]; if(![OyTool ShardInstance].bIsForReview) { [self actionCustomNavBtn:btnRigth nrlImage:@"" htlImage:@"" title:@"全部分类▽"]; } else { [self actionCustomNavBtn:btnRigth nrlImage:@"" htlImage:@"" title:[dicTypeName.allValues objectAtIndex:0]]; } self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btnRigth]; AllProTypeView* tview = [[AllProTypeView alloc] initWithFrame:self.view.bounds]; tview.delegate = self; //赋于下拉的里效果视图 dropdownView = [[LMDropdownView alloc] init]; dropdownView.menuBackgroundColor = [UIColor whiteColor]; dropdownView.menuContentView = tview;
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:下拉弹出列表选择项效果
关键词:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。