IOS代码笔记之下拉选项cell
更新时间:2016年07月06日 09:38:58 作者:情深雨蒙
这篇文章主要为大家详细介绍了IOS代码笔记之下拉选项cell的相关资料,需要的朋友可以参考下
本文介绍了IOS下拉选项cell的使用方法,供大家参考,具体内容如下
一、效果图
二、工程图
三、代码
RootViewController.h
#import <UIKit/UIKit.h> //加入头文件 #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]; }
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
相关文章
iOS 解决UICollectionView 计算 Cell 大小的问题
本文主要介绍iOS UICollectionView,这里给大家一个实例代码作为参考,并指出经常遇到的问题和解决办法,希望能帮助有需要的小伙伴2016-07-07cmake ios终端下执行提示错误 iOS version not found, tested: [5.0;5.1;6
这篇文章主要介绍了cmake ios终端下执行提示错误 iOS version not found, tested: [5.0;5.1;6.0;6.1;7.0;8.3]的解决方案的相关资料,需要的朋友可以参考下2016-10-10
最新评论