LXFPhotoHelper 调用系统相机与相册 项目简介
一行代码实现调用系统相机与相册,可配置导航栏背景与字体颜色。自定义样式// 配置LXFPhotoConfig *config = [[LXFPhotoConfig alloc] init];
config.navBarTintColor = [UIColor greenColor];
config.navBarBgColor = [UIColor purpleColor];
config.navBarTitleColor = [UIColor yellowColor];// sourceType : // UIImagePickerControllerSourceTypeCamera // UIImagePickerControllerSourceTypePhotoLibrary 等[[LXFPhotoHelper creatWithSourceType:sourceType config:config] getSourceWithSelectImageBlock:^(id data) { if ([data isKindOfClass:[UIImage class]]) { // 图片
[self.imageView setImage:(UIImage *)data];
} else { NSLog(@"所选内容非图片对象");
}
}];默认样式默认样式可避免自定义导航栏后出现的问题(导航栏背景、标题、按键皆为白色,看不清楚)// config 传入 nil[[LXFPhotoHelper creatWithSourceType:sourceType config:nil] getSourceWithSelectImageBlock:^(id data) { if ([data isKindOfClass:[UIImage class]]) { // 图片
[self.imageView setImage:(UIImage *)data];
} else { NSLog(@"所选内容非图片对象");
}
}];
config.navBarTintColor = [UIColor greenColor];
config.navBarBgColor = [UIColor purpleColor];
config.navBarTitleColor = [UIColor yellowColor];// sourceType : // UIImagePickerControllerSourceTypeCamera // UIImagePickerControllerSourceTypePhotoLibrary 等[[LXFPhotoHelper creatWithSourceType:sourceType config:config] getSourceWithSelectImageBlock:^(id data) { if ([data isKindOfClass:[UIImage class]]) { // 图片
[self.imageView setImage:(UIImage *)data];
} else { NSLog(@"所选内容非图片对象");
}
}];默认样式默认样式可避免自定义导航栏后出现的问题(导航栏背景、标题、按键皆为白色,看不清楚)// config 传入 nil[[LXFPhotoHelper creatWithSourceType:sourceType config:nil] getSourceWithSelectImageBlock:^(id data) { if ([data isKindOfClass:[UIImage class]]) { // 图片
[self.imageView setImage:(UIImage *)data];
} else { NSLog(@"所选内容非图片对象");
}
}];