Как программно добавить UITextField
на UIView
в программировании iPhone?
UITextField* text;
UIView* view = [[UIView alloc]init];
[view addSubview:???];
Objective-C:
CGRect someRect = CGRectMake(0.0, 0.0, 100.0, 30.0);
UITextField* text = [[UITextField alloc] initWithFrame:someRect];
UIView* view = [[UIView alloc] initWithFrame:someRect];
[view addSubview:text];
Swift:
let someFrame = CGRect(x: 0.0, y: 0.0, width: 100.0, height: 30.0)
let text = UITextField(frame: someFrame)
let view = UIView(frame: someFrame)
view.addSubview(text)