博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【代码笔记】iOS-下拉选项cell
阅读量:4309 次
发布时间:2019-06-06

本文共 1196 字,大约阅读时间需要 3 分钟。

一,效果图。

 

二,工程图。

三,代码。

RootViewController.h

#import 
//加入头文件#import "ComboBoxView.h"@interface RootViewController : UIViewController{ ComboBoxView *_comboBox;}@end

 

RootViewController.m

#import "RootViewController.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.navigationController.navigationBarHidden=YES;            NSArray *comboBoxDatasource = [[NSArray alloc] initWithObjects:@"one", @"two", @"three", @"four", @"five", @"six", @"seven", @"eight", nil];    _comboBox = [[ComboBoxView alloc] initWithFrame:CGRectMake(20, 20, 280, 140)];    _comboBox.comboBoxDatasource = comboBoxDatasource;    _comboBox.backgroundColor = [UIColor clearColor];    [_comboBox setContent:[comboBoxDatasource objectAtIndex:0]];    [self.view addSubview:_comboBox];        }

 

 

 
 

转载于:https://www.cnblogs.com/yang-guang-girl/p/5628877.html

你可能感兴趣的文章
一些程序和工具
查看>>
java8 运算语法集
查看>>
IDEA关于重命名
查看>>
Es6 中let var和 const 了解
查看>>
巧用队列之”Voting“
查看>>
Oracle数据类型number(m,n)
查看>>
ACC 001 C - Shorten Diameter 图论
查看>>
开通博客了...
查看>>
[转]复制虚拟机后linux中的eth0变成eth1问题
查看>>
TableViewCell中自定义XIB的使用
查看>>
ubuntu 显示隐藏文件
查看>>
Linux 定时任务crontab
查看>>
mongoose联表查询与一般查询合并
查看>>
jQuery--内容过滤和可见性过滤
查看>>
Android手机总是提示:存储空间不足,解决方法
查看>>
MySQL 函数之求取一个表中的某个字段的中位数
查看>>
EntityFramework 更新数据库字段的三种方法
查看>>
hdu 1253 胜利大逃亡
查看>>
python异步编程之asyncio
查看>>
leetcode算法:Trim a Binar Search Tree
查看>>