我该如何在 Objective-C 中创建和定位一个新的 ImageView?
谢谢!
我尝试过这个,但它似乎没有起作用...
-(void)drawStars{ //uses random numbers to display a star on screen
//create random position
int xCoordinate = arc4random() % 10;
int yCoordinate = arc4random() % 10;
UIImageView *starImgView = [[UIImageView alloc] initWithFrame:CGRectMake(xCoordinate, yCoordinate, 58, 40)]; //create ImageView
starImgView.image = [UIImage imageNamed:@"star.png"];
[starImgView release];
我把这个方法放在我的视图控制器中。我看到一些CG的东西,我需要导入核心图形库或者其他什么吗?(顺便问一下,什么是核心图形库?)