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

    

}

 

相关文章:

  • 2022-12-23
  • 2021-12-29
  • 2021-11-15
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2021-12-02
  • 2021-04-19
猜你喜欢
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2021-05-13
  • 2021-05-11
  • 2022-12-23
相关资源
相似解决方案