Sunday, December 29, 2013

How to define multiple controls? Controls such as buttons

How to write code in the form? ? No need to use IB
Reply:
UIButton * button = [UIButton buttonWithType: UIButtonTypeCustom];
/ / Set the properties
button.frame = CGRectMake (...);
...
[Button addTarget: self action: @ selector (response function name :) forControlEvents: UIControlEventTouchUpInside];

[MainView addSubiew: button]

This is probably right
Reply:
I know the definition is to define multiple? How to define??? Was not always need to create a control object?
Reply:
sure

No comments:

Post a Comment