读取Photos全部图标的方法(转)
来源:互联网 发布:空气质量 数据 编辑:程序博客网 时间:2024/06/05 18:37
NSString *mainDir=[NSString stringWithFormat:@"/var/mobile/Media/Photos/Thumbs"]; //所有照片都存在该路径下
NSArray *childrenFilenames = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:mainDir error:nil];
float i=0.0,j=0.0;
for(NSString *fn in childrenFilenames) {
NSString *tempStr=[mainDir stringByAppendingPathComponent:fn];
NSDictionary *attributes = [[NSFileManager defaultManager] fileAttributesAtPath:tempStr traverseLink:NO];
BOOL isDirectory=[[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeDirectory];
if (isDirectory) {
NSArray *imageFile = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:tempStr error:nil];
NSString *imagePath=[tempStr stringByAppendingPathComponent:[imageFile objectAtIndex:0]];
NSLog(@"the image filedirectory is %@",imagePath);
UIImage *img=[UIImage imageWithContentsOfFile:imagePath];
UIImageView *imgView=[[UIImageView alloc] initWithImage:img];
[imgView setFrame:CGRectMake(i, j, 150, 150)];
[self.view addSubview:imgView];
[imgView release];
i+=100.0;
j+=100.0;
}
}
- 读取Photos全部图标的方法(转)
- C#中读取“已注册的文件类型”的图标及读取指定文件图标的方法 (转)
- C++图像批处理:读取文件夹中全部图像的方法
- C#中读取“已注册的文件类型”的图标及读取指定文件图标的方法
- C#中读取“已注册的文件类型”的图标及读取指定文件图标的方法
- C#中读取“已注册的文件类型”的图标及读取指定文件图标的方法
- C#中读取“已注册的文件类型”的图标及读取指定文件图标的方法
- C#中读取“已注册的文件类型”的图标及读取指定文件图标的方法
- 文件图标的读取
- BigDecimal全部方法简介 (转)
- photos
- jquery easyui 全部图标
- myeclipse 里面的server 配置的 tomcat 图标全部不见
- DrawerLayout图标的方法
- 遍历二叉树的全部方法(递归+非递归)
- 修复保存的网页的图标,全部变成可执行程序的图标了
- window xp的快速启动图标全部被更改为IE浏览器图标的解决办法
- 『iOS/Obj-C』App所需要的全部的icon图标尺寸(单位px)
- HTML、XML、CSS、JavaScript、JSP注释详解
- Java经典试题及答案
- picture
- Thunderbird + Enigmail + GPG实现电子邮件签名和加密
- Java基础方面
- 读取Photos全部图标的方法(转)
- 又玩了下3DL
- JAVA笔试试题(一)
- FTP协议的分析和扩展
- 需求分析师的工作重点
- 开门游戏
- 建模之感想
- LaTeX文档插入图片的几种常用方法
- java转换xml、list、map和json