【代码笔记】iOS-下拉选项cell

一,效果图。

【代码笔记】iOS-下拉选项cell

二,工程图。

【代码笔记】iOS-下拉选项cell

三,代码。

RootViewController.h

【代码笔记】iOS-下拉选项cell
#import <UIKit/UIKit.h>
//加入头文件
#import "ComboBoxView.h" @interface RootViewController : UIViewController
{
ComboBoxView *_comboBox;
} @end
【代码笔记】iOS-下拉选项cell

RootViewController.m

【代码笔记】iOS-下拉选项cell
#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-下拉选项cell
 
 
上一篇:【转载】简述Linux的启动过程


下一篇:NET Core全新的开发体验