logo
  • 教程列表
  • SO官方文档
  • 设置视图背景
    • 设置视图背景
    • 填写 UIView 的背景图像
    • 设置视图背景与图像
    • 创建渐变背景视图
  1. StackOverflow 文档
  2. iOS 教程
  3. 设置视图背景
  4. 填写 UIView 的背景图像

填写 UIView 的背景图像

Created: November-22, 2018

Objective-C

 placeholderCopyUIGraphicsBeginImageContext(self.view.frame.size);
 [[UIImage imageNamed:@"image.png"] drawInRect:self.view.bounds];
 UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
 UIGraphicsEndImageContext();     
 self.view.backgroundColor = [UIColor colorWithPatternImage:image];
  • 设置视图背景与图像
  • 设置视图背景

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明