我想躺在背景圖像的頂部按鈕在cocos2d一個UIAlertView中。它不適用於下面的代碼。有什麼建議麼?
UIAlertView *Win=[[UIAlertView alloc] initWithTitle:@"You Win" message:nil delegate:self cancelButtonTitle:@"Next" otherButtonTitles:@"Replay",@"Quit", nil];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(-50, -30, 400, 300)];
NSString *path = [[NSString alloc] initWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"levelcleared.png"]];
UIImage *bkgImg = [[UIImage alloc] initWithContentsOfFile:path];
UIImageView *imageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(20, 200, 70, 70)];
NSString *path2= [[NSString alloc] initWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"alertviewhome.png"]];
UIImage *bkgImg2 = [[UIImage alloc] initWithContentsOfFile:path2];
imageView2.
[imageView setImage:bkgImg];
[imageView2 setImage:bkgImg2];
[bkgImg release];
[path release];
[Win addSubview:imageView];
[Win addSubview:imageView2];
[imageView release];
[Win show];
[Win release];
而你的問題是什麼? –
ssorry dude按下提交太快。 –
所以問題在上面。它不會讓我將按鈕添加到自定義UIAlertView的背景圖像。 –