小问题,工程上蓝色文件夹怎么引用的问题 图片 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 使用UIImage *image = [UIImage imageNamed:@"tupian/9.jpg"]; 得不到图片吗? 你先clean 一下工程,重新编译运行试试 我是说这个可以,用图片中这个方法 NSString *path = [[NSBundle mainBundle]pathForResource:@"9.jpg" ofType:nil inDirectory:@"tupian"]; NSLog(@"%@",path); //self.imageview.image = [UIImage imageNamed:path]; self.imageview.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@/tupian/9.jpg",path]];就不可以,不是得到文件的路径就行了吗 我是说这个可以,用图片中这个方法 NSString *path = [[NSBundle mainBundle]pathForResource:@"9.jpg" ofType:nil inDirectory:@"tupian"]; NSLog(@"%@",path); //self.imageview.image = [UIImage imageNamed:path]; self.imageview.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@/tupian/9.jpg",path]];就不可以,不是得到文件的路径就行了吗你的用法用错了。改成这样 NSString *path = [[NSBundle mainBundle]pathForResource:@"9" ofType:@"jpg" inDirectory:@"tupian"];NSLog(@"path:%@",path);self.imageView.image=[UIImage imageWithContentsOfFile:path]; 我是说这个可以,用图片中这个方法 NSString *path = [[NSBundle mainBundle]pathForResource:@"9.jpg" ofType:nil inDirectory:@"tupian"]; NSLog(@"%@",path); //self.imageview.image = [UIImage imageNamed:path]; self.imageview.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@/tupian/9.jpg",path]];就不可以,不是得到文件的路径就行了吗你的用法用错了。改成这样 NSString *path = [[NSBundle mainBundle]pathForResource:@"9" ofType:@"jpg" inDirectory:@"tupian"];NSLog(@"path:%@",path);self.imageView.image=[UIImage imageWithContentsOfFile:path];感谢!!原来是这样。 NSURLConnection 判断是否下载成功 一段代码,关于release问题 cocos2d和uiview切换问题 xcode project navigator里面的路径错了怎么办? iphone 使用RestKit解析JSON中的数组问题 初级的iphone应用开发,需要掌握些什么?欢迎讨论 vc获取iphone基本信息 cocoapods不支持的点三方库,怎么用cocoapods导入 请问IOS6和ios7都有什么区别 AFNETWORKING求助 误删info.strings怎么恢复 UIScrollView滑动的问题,纠结很久了.
UIImage *image = [UIImage imageNamed:@"tupian/9.jpg"]; 得不到图片吗? 你先clean 一下工程,重新编译运行试试
NSLog(@"%@",path);
//self.imageview.image = [UIImage imageNamed:path];
self.imageview.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@/tupian/9.jpg",path]];就不可以,不是得到文件的路径就行了吗
NSLog(@"%@",path);
//self.imageview.image = [UIImage imageNamed:path];
self.imageview.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@/tupian/9.jpg",path]];就不可以,不是得到文件的路径就行了吗
你的用法用错了。改成这样
NSString *path = [[NSBundle mainBundle]pathForResource:@"9" ofType:@"jpg" inDirectory:@"tupian"];
NSLog(@"path:%@",path);
self.imageView.image=[UIImage imageWithContentsOfFile:path];
NSLog(@"%@",path);
//self.imageview.image = [UIImage imageNamed:path];
self.imageview.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@/tupian/9.jpg",path]];就不可以,不是得到文件的路径就行了吗
你的用法用错了。改成这样
NSString *path = [[NSBundle mainBundle]pathForResource:@"9" ofType:@"jpg" inDirectory:@"tupian"];
NSLog(@"path:%@",path);
self.imageView.image=[UIImage imageWithContentsOfFile:path];
感谢!!原来是这样。