Iphone UIImageView*XXX=[[UIImageView alloc]initWithImage:XXX]
这行代码是什么:Iphone UIImageView*XXX=[[UIImageView alloc]initWithImage:XXX],iphone,cocoa-touch,animation,random,uiimageview,Iphone,Cocoa Touch,Animation,Random,Uiimageview,这行代码是什么: 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 th
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];
该行:
UIImageView*flakeView=[[UIImageView alloc]initWithImage:flakeImage]代码>
创建一个容器“UIImageView”
对象,该对象包含存储在ivar图像中的图像“UIImage”
其余的代码在主视图上放置flakeView
,并具有指定的x、y、width和hight属性。是的,但当我希望该flakeImage与另一个图像碰撞时,我不知道会发生什么,但如果不接触另一个图像,它会发生碰撞,我认为这是由于容器造成的。我怎样才能解决这个问题?你想知道这行代码做了什么,我告诉你我不知道你在说什么?这里的代码只是一个视图的初始化!