UIImageView* XXX = [[UIImageView alloc] initWithImage:XXX]
WHat does this line of code :
UIImageView* flakeView = [[UIImageView alloc] initWithImage:flakeImage];
if it help Then I have this :
int startX2 = round(random() % 480);
//开发者_如何学JAVA set the flake start position
flakeView.frame = CGRectMake(startX2, 330.0, 30, 20);
flakeView.alpha = 1;
// put the flake in our main view
[self.view addSubview:flakeView];
The line:
UIImageView* flakeView = [[UIImageView alloc] initWithImage:flakeImage];
creates a container "UIImageView"
object that contains an image "UIImage"
stored in an ivar flakeImage
The rest of the code positions flakeView
on the main view with assigned x,y,width and hight properties.
精彩评论