Xcode 设置图片全屏显示

- (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];  //背景设置

}

上一篇:ebtablesBridge


下一篇:sql连接查询INNER JOIN,LEFT JOIN,RIGHT JOIN区别