开发者

UIImageView* XXX = [[UIImageView alloc] initWithImage:XXX]

开发者 https://www.devze.com 2023-03-04 06:35 出处:网络
WHat does this line of code : UIImageView* flakeView = [[UIImageView alloc] initWithImage:flakeImage];

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消