【代码笔记】iOS-下拉菜单
来源:互联网 发布:root刷机软件 编辑:程序博客网 时间:2024/05/21 07:56
一,效果图。
二,工程图。
三,代码。
RootViewController.h
#import <UIKit/UIKit.h>@interface RootViewController : UIViewController@end
RootViewController.m
#import "RootViewController.h"#import "NIDropDown.h"@interface RootViewController ()@end@implementation RootViewController- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self;}- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. self.title=@"DropDown"; UIButton *button=[UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame=CGRectMake(10, 100, 150,30); button.backgroundColor=[UIColor redColor]; [button addTarget:self action:@selector(doClickAction:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:button]; }-(void)doClickAction:(UIButton *)btn{ NSArray *dataArray=[NSArray arrayWithObjects:@"1",@"2",@"3",@"4",@"5", nil]; NIDropDown *dropDown=[[NIDropDown alloc]init]; [dropDown showDropDown:btn andHeight:[dataArray count]*36 andData:dataArray]; [self.view addSubview:dropDown];}
0 0
- 【代码笔记】iOS-下拉菜单
- [网页代码]下拉菜单
- 隐藏下拉菜单代码
- 经典下拉菜单代码
- 下拉菜单关键代码
- 下拉菜单代码分享
- iOS实现下拉菜单
- IOS 实现下拉菜单
- iOS 下拉菜单
- IOS下拉菜单
- iOS 多级下拉菜单
- 【代码笔记】iOS-下拉选项cell
- 【代码笔记】iOS-DropDownDemo-下拉按钮效果
- javascipt之博客前端自定义下拉菜单代码笔记
- 增加下拉菜单的代码
- 下拉及弹出式菜单代码
- JavaScript 下拉菜单实现代码
- JS下拉缓冲菜单代码
- 同步IO/异步IO/阻塞IO/非阻塞IO
- java线程详解
- Javascript的this用法
- 安卓屏幕适配全攻略一网打尽
- 设计模式
- 【代码笔记】iOS-下拉菜单
- 引用的特点和注意事项
- hdu1269(强联通分量模版)
- .Net Core[译文]
- XMPPFramework的使用
- R语言——Plot{graphics}
- 彻底理解View事件体系!
- encrypt加密 decrypt解密 函数
- STL之multiset