2013-01-08 43 views

回答

1

我認爲你需要簡單的代碼是這樣的:

UIView* backgroundView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // create background view with frame of all screen 
backgroundView.backgroundColor = [UIColor blackColor]; // set it color 

UIImageView* image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"]]; // create image view with image you want 
image.frame = CGRectMake(10, 10, 300, 300); // set frame, better to set frame in depending of backgroundView frame, because we've got few types of iOS devices with different displays 
[backgroundView addSubview:image]; // place created image to background 

UILabel* textLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)]; // create frame you want with similar way as image 
textLabel.backgroundColor = UIColor.clearColor; 
[backgroundView addSubview:textLabel]; 
[self.view addSubview:backgroundView]; // add created backgroundView to your UIViewController's background 
1

使用標準的iOS SDK功能,操作UIView和標籤。
你不想爲此做任何事情。只需設置一些框架並查看層次結構。

1

看看石英/核心圖形的那種繪畫(學習目的)。 The Quartz 2D Programming Guide是一個開始學習更多關於它的好地方。

如果您不是爲了學習目的而這樣做,您可以輕鬆地在視圖,圖像視圖和標籤上進行此操作。設置完成都可以在Interface Builder中完成(儘管學習起來不是很有用)。