图片文件放在项目目录下

 #import "ViewController.h"

 @interface ViewController ()

 @end

 @implementation ViewController

 - (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// [self.view addSubview:];]
NSString *path = [[NSBundle mainBundle] pathForResource:@"snow" ofType:@"jpg"]; UIImage *image = [UIImage imageWithContentsOfFile:path];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
[imageView setFrame:CGRectMake(, , image.size.width, image.size.height)];
[self.view addSubview:imageView];
// self.imageview.image = image; } - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
} @end

最新文章

  1. 【XLL 框架库函数】 TempActiveRow/TempActiveRow12
  2. Effective Objective-C 2.0 — 第12条:理解消息转发机制
  3. VTK初学一,e_Triangle三角形的绘制
  4. ASP.NET Web API 数据验证
  5. 如何通过阅读C标准来解决C语言语法问题
  6. 安装Ubuntu14.04版本的操作系统
  7. 基于selenium的pyse自动化测试框架
  8. 在Jena框架下基于MySQL数据库实现本体的存取操作
  9. 3244: [Noi2013]树的计数 - BZOJ
  10. web开发工具类
  11. 在.Net中进行跨线程的控件操作(下篇:BackgroundWorker)
  12. mysql 分区表详解
  13. treeview树形菜单,递归
  14. Paint获取Text的宽和高的数据
  15. INFORMATION_SCHEMA.PROFILING
  16. 前端性能核对表Checklist-2018
  17. JavaScript基础函数---李老师的
  18. 洛谷P3959 宝藏
  19. kickstart-E
  20. CSS布局学习(三) - position属性定义及解释(官网直译)

热门文章

  1. FTP指令说明
  2. Java循环中删除一个列表元素
  3. linux系统的开机流程
  4. 改动Centosserver主机名称
  5. react组件是怎么来的
  6. openstack页面自己定义插件使用具体解释(django、ajax、post)(zTree为例)
  7. MongoDB升级导致启动失败
  8. 破碎纪念---记第二次Nexus4换屏
  9. Write a program that gives count of common characters presented in an array of strings..(or array of
  10. Codeforces Round #322 (Div. 2) D. Three Logos 模拟