Drop-down cell, drop-down cell
:
Engineering Drawing:
This code imports the third-party library comboBox.
Code:
RootViewController. h
# Import <UIKit/UIKit. h> // Add the header file # import "ComboBoxView. h" @ interface RootViewController: UIViewController {ComboBoxView * _ comboBox;} @ end
RootViewController. m
-(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];}