iOS开发项目点总结(一)

1.当前工程版本号

params[@"version"] = [[[NSBundle mainBundle]infoDictionary]objectForKey:@"CFBundleShortVersionString"];

2.当前设备序列号唯一标示

NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

3.将状态栏文字设置成白色;导航栏设置成黑色;标签栏设置成黑色,上面的图标,文字为白色。

iOS开发项目点总结(一)_第1张图片

4.在导航控制器里自定义返回按钮

iOS开发项目点总结(一)_第2张图片

//需将默认的先隐藏掉

5.iOS加载本地html网页

iOS开发项目点总结(一)_第3张图片

6.播打电话

7.tableview 分割线,cell箭头、选中风格

self.tableView.separatorColor = [UIColor colorWithRed:37/255.0 green:37/255.0 blue:41/255.0 alpha:1];

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

cell.selectionStyle = UITableViewCellSelectionStyleNone;

8.图片进行缓存并读取

iOS开发项目点总结(一)_第4张图片
iOS开发项目点总结(一)_第5张图片




附:方便粘贴

//状态栏颜色

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

//导航栏

UINavigationBar *bar = [UINavigationBar appearance];

[bar setBarStyle:UIBarStyleBlack];

//标签栏

UITabBar *tabBar = [UITabBar appearance];

[tabBar setBarStyle:UIBarStyleBlack];

[tabBar setTintColor:[UIColor whiteColor]];


//左

self.navigationItem.hidesBackButton = YES;

CGRect backRect = [UIButton getRectWithX:0 Y:0 width:12 andHeight:22];

myButton *backBtn = [myButton buttonWithType:UIButtonTypeCustom frame:backRect tag:1 image:@"back@2x" andBlock:^(myButton *button) {

[self.navigationController popViewControllerAnimated:YES];

}];

UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView:backBtn];

self.navigationItem.leftBarButtonItem = leftItem;


//加载本地html

UIWebView *webView = [[UIWebView alloc]initWithFrame:SCREEN];

NSString *path = [[NSBundle mainBundle]bundlePath];

NSURL *baseURL = [NSURL fileURLWithPath:path];

NSString *htmlPath = [[NSBundle mainBundle]pathForResource:self.nameStr ofType:@"html"];

NSLog(@"%@",htmlPath);

NSString *htmlStr = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil];

[webView loadHTMLString:htmlStr baseURL:baseURL];

[self.view addSubview:webView];


//拨打客服电话

NSMutableString *str=[[NSMutableString alloc] initWithFormat:@"tel:%@",_customerLabel.text];

[[UIApplication sharedApplication]openURL:[NSURL URLWithString:str] options:@{} completionHandler:nil];


//存

if (self.qianziphoto != nil) {

            NSString *path_sandox = NSHomeDirectory();

             //设置一个图片的存储路径

             NSString *qianziPhotoPath = [path_sandox    stringByAppendingString:@"/Documents/qianziPhoto.png"];

            //把图片直接保存到指定的路径(同时应该把图片的路径imagePath存起来,下次就可以直接用来取)

            [UIImagePNGRepresentation(self.qianziphoto) writeToFile:qianziPhotoPath atomically:YES];

           //保存路径

           param[@"idcardFrontFile"] = qianziPhotoPath;

}

[defaults setObject:param forKey:@"Activate"];

//取

self.qianziphoto =  [[UIImage alloc] initWithContentsOfFile: [defaults objectForKey:@"Activate"][@"idcardFrontFile"] ];

if (self.qianziphoto != nil) {

          [_qianziBtn setImage:self.qianziphoto forState:UIControlStateNormal];

}else{

          [_qianziBtn setImage:[UIImage imageNamed:@"add_photo2@2x"] forState:UIControlStateNormal];

}

你可能感兴趣的:(iOS开发项目点总结(一))