Class hierarchy of UIResponder as well as subclasses of UIView and UIControl
2014-06-24 10:16
555 查看
When you were dragging in your label and your button to this view, you were adding them as subviews.
By doing this programmatically you can see what goes into adding a subview. You’d
need to pass in a frame to the alloc:initWithFrame: method, which is found on
most UIView subclasses:
CGRect frame = CGRectMake(0,0,100,20); UILabel *label = [[UILabel alloc] initWithFrame:frame]; // To add this label to its parent view within a view controller, all you have to // do is use the addSubView: function. [self.view addSubView:label]; // Retrieving the frame, making a change to its size or origin, and then // resetting its frame property CGRect frame = label.frame; frame.origin.x = 10; frame.size.width = 200; [label setFrame:frame];
相关文章推荐
- Why do many Collection classes in Java extend the abstract class and implement the interface as well
- 解决Can't find common super class of [android/app/Application] (with 4 known super classes) and [com/m
- The Interface and Class Hierarchy Diagram of Java Collections
- How to subclass CListBox and CEdit inside of CComboBox
- Javascript Module pattern template. Shows a class with a constructor and public/private methods/properties. Also shows compatibility with CommonJS(eg Node.JS) and AMD (eg requireJS) as well as in a br
- [Scarab] Structure and Class Hierarchy
- Spring 异常 Couldn't generate CGLIB subclass of class [class spring.dao.UserDAO]: Common causes of this problem include using a f
- The three classes of devices and modules
- Hierarchy of Classes
- a partial OTcl class hierarchy of NS
- Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
- the list of creative,well designed and 100% pure Flex Websites(11+)
- static, const, reference and class object, as datamembers
- Mothers as Seen Through the Eyes, and the Years, of TV and Film
- Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers
- VB6:关于“Only public user defined types defined in public object modules can be used as parameters or return types for public procedures of class modules or as fields of public user defined types.”的编译错误
- A c++ class wrapper to simplify the use of CRITICAL_SECTION and avoid dead-lock
- A c++ class wrapper to simplify the use of CRITICAL_SECTION and avoid dead-lock
- The class hierarchy of Gears
- [Drupal] Simple tutorial of setting multi subdomain with Domain Access module and Views module