WHat执行以下代码行:
UIImageView* flakeView = [[UIImageView alloc] initWithImage:flakeImage];如果它有帮助,那么我有这个:
int startX2 = round(random() % 480);
// 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];发布于 2011-05-08 16:16:53
这行代码:
UIImageView* flakeView = [[UIImageView alloc] initWithImage:flakeImage];
创建一个容器"UIImageView"对象,该对象包含存储在ivar flakeImage中的图像"UIImage"
其余代码将flakeView定位在主视图上,并分配了x、y、width和hight属性。
https://stackoverflow.com/questions/5926244
复制相似问题