标签:
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.//
UIImage *image = [UIImage imageNamed:@"initial_page_bg.jpg" ];
UIImageView *imageView = [[UIImageView alloc]initWithImage:image];
CGRect cr=[[UIScreen mainScreen] bounds]; //获取屏幕
imageView.frame = CGRectMake(0, 0, cr.size.width, cr.size.height); //全屏显示图片
[imageView setContentMode:UIViewContentModeScaleToFill]; //拉伸模式
[imageView setClipsToBounds:YES];
[self.view addSubview:imageView]; //显示
[self.view sendSubviewToBack:imageView]; //背景设置
}
标签:
原文地址:http://www.cnblogs.com/winvay/p/5838180.html