This shows you the differences between two versions of the page.
objective-c:uikit.framework:uiimageview.h:init [2013/01/01 20:36] Mo created |
objective-c:uikit.framework:uiimageview.h:init [2024/02/16 01:12] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | =====init===== | ||
+ | <code objc> | ||
+ | |||
+ | - (id)init; | ||
+ | |||
+ | </code> | ||
+ | |||
+ | Returns a UIImageView. | ||
+ | |||
+ | **Return Value** | ||
+ | - UIImageView | ||
+ | |||
+ | |||
+ | ===== ObjC Sourcecode Example ===== | ||
+ | |||
+ | <code objc> | ||
+ | |||
+ | // ** Initialize imageView ** | ||
+ | UIImageView *myImageView = [[UIImageView alloc]init]; | ||
+ | |||
+ | // ** Output ** | ||
+ | NSLog(@"%@", myImageView); | ||
+ | |||
+ | </code> | ||
+ | |||
+ | If you look at the output for this example code, you`ll see that the imageview`s frame values are "0 0 ; 0 0"! | ||
+ | This is because no frame was set yet. You need to set the frame of the imageview or it will not be visible after adding it to the view.\\ | ||
+ | It`s recommend to use "[[objective-c:uikit.framework:uiimageview.h:initwithframe|initWithFrame]]". | ||
+ | |||
+ | |||
+ | ==== Output for this example code ==== | ||
+ | <code> | ||
+ | |||
+ | 2013-01-01 20:33:22.558 UIImageViewSample[553:11303] <UIImageView: 0x75891c0; frame = (0 0; 0 0); userInteractionEnabled = NO; layer = <CALayer: 0x7588cb0>> | ||
+ | |||
+ | </code> |