整理IOS开发常用小Tips
vc.hidesBottomBarWhenPushed = YES;
vc.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"left" style:UIBarButtonItemStylePlain target:self action:@selector(back)];
vc.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:self action:nil];
}
[super showViewController:vc sender:sender];
}
{
[self popViewControllerAnimated:YES];
}
NSString *rootPath = @"/Users/wanghong/Desktop/test";
NSArray *subPaths = [mgr subpathsAtPath:rootPath];
long long totolSize = 0;
for (NSString *pathString in subPaths) {
NSString *path = [rootPath stringByAppendingPathComponent:pathString];
//NSLog(@"%@",path);
BOOL dir = NO;
[mgr fileExistsAtPath:path isDirectory:&dir];
if (dir == NO) {
totolSize += [[mgr attributesOfItemAtPath:path error:nil][NSFileSize] longLongValue];
}
}
CGFloat size = totolSize/1000.0/1000.0; //size结果字节为单位
_sizeLabel.text = [NSString stringWithFormat:@"%fMB",size];
//CLEAN
[mgr removeItemAtPath:rootPath error:nil];
UIImageWriteToSavedPhotosAlbum(image, NULL, NULL, NULL);
UIPanGestureRecognizer
有时候会影响 UITableView
的
Scroll 操作。由于你已经设置了 Cell 的 Pan 手势识别器 的 UIGestureRecognizerDelegate
,你只需要实现一个(有些滑稽且冗长命名的)
delegate 方法即可将一切恢复正常。{
return NO;
self.gifView = [[UIWebView alloc]init];
self.gifView.frame = CGRectMake(0, 0, self.frame.size.width, kCellHeight);
self.gifView.userInteractionEnabled = NO;
[self.gifView loadData:gif MIMEType:@"image/gif" textEncodingName:nil baseURL:nil];
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
// 不需要动画
[super pushViewController:viewController animated:NO];
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。