1
嗨,大家好,我是法國人,所以我嘲笑我的英語這裏是我的問題:我們如何定義視圖的高度和寬度。這裏它的名字是flakeView。下面是代碼:xcode如何定義視圖的高度和寬度
UIImageView* flakeView = [[[UIImageView alloc] initWithImage:flakeImage] autorelease];
// use the random() function to randomize up our flake attributes
int startY = round(random() % 320);
// set the flake start position
flakeView.center = CGPointMake(490, startY);
flakeView.alpha = 1;
// put the flake in our main view
[self.view addSubview:flakeView];
[UIView animateWithDuration:7
animations:^{
// set the postion where flake will move to
flakeView.center = viewToRotate.center;
}];