开发笔记 那些年追过的图片(三):自定义修改拍照界面retake和use按钮
2013-09-13 14:41
507 查看
-(UIView *)findView:(UIView *)aView withName:(NSString *)name{
Class cl = [aView class];
NSString *desc = [cl description];
if ([name isEqualToString:desc])
return aView;
for (NSUInteger i = 0; i < [aView.subviews count]; i++)
{
UIView *subView = [aView.subviews objectAtIndex:i];
subView = [self findView:subView withName:name];
if (subView)
return subView;
}
return nil;
}
-(void)addSomeElements:(UIViewController *)viewController{
UIView *PLCameraView=[self findView:viewController.view withName:@"PLCameraView"];
UIView *bottomBar=[self findView:PLCameraView withName:@"PLCropOverlayBottomBar"];
UIImageView *bottomBarImageForSave = [bottomBar.subviews objectAtIndex:0];
UIButton *retakeButton=[bottomBarImageForSave.subviews objectAtIndex:0];
[retakeButton setTitle:@"重拍" forState:UIControlStateNormal]; //左下角按钮
UIButton *useButton=[bottomBarImageForSave.subviews objectAtIndex:1];
[useButton setTitle:@"上传" forState:UIControlStateNormal]; //右下角按钮
}
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
[self addSomeElements:viewController];
}
Class cl = [aView class];
NSString *desc = [cl description];
if ([name isEqualToString:desc])
return aView;
for (NSUInteger i = 0; i < [aView.subviews count]; i++)
{
UIView *subView = [aView.subviews objectAtIndex:i];
subView = [self findView:subView withName:name];
if (subView)
return subView;
}
return nil;
}
-(void)addSomeElements:(UIViewController *)viewController{
UIView *PLCameraView=[self findView:viewController.view withName:@"PLCameraView"];
UIView *bottomBar=[self findView:PLCameraView withName:@"PLCropOverlayBottomBar"];
UIImageView *bottomBarImageForSave = [bottomBar.subviews objectAtIndex:0];
UIButton *retakeButton=[bottomBarImageForSave.subviews objectAtIndex:0];
[retakeButton setTitle:@"重拍" forState:UIControlStateNormal]; //左下角按钮
UIButton *useButton=[bottomBarImageForSave.subviews objectAtIndex:1];
[useButton setTitle:@"上传" forState:UIControlStateNormal]; //右下角按钮
}
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
[self addSomeElements:viewController];
}
相关文章推荐
- 开发笔记 那些年追过的图片(三):自定义修改拍照界面retake和use按钮
- iOS-自定义修改拍照界面retake和use按钮
- iOS-自定义修改拍照界面retake和use按钮
- iOS-自定义修改拍照界面retake和use按钮
- 开发笔记 那些年追过的图片(一): image的读取
- 开发笔记 那些年追过的图片(七):屏幕截图
- 开发笔记 那些年追过的图片(二): 读取相册里的图片 和 拍摄获取照片
- 开发笔记 那些年追过的图片(七):屏幕截图
- 开发笔记 那些年追过的图片(十) 图片处理成圆形
- 开发笔记 那些年追过的图片(四):读取图片的信息
- 开发笔记 那些年追过的图片(五):imageView GIF 动画
- 开发笔记 那些年追过的图片(二): 读取相册里的图片 和 拍摄获取照片
- 开发笔记 那些年追过的图片(八):PNG,JPEG格式相互转换
- 开发笔记 那些年追过的图片(六):压缩图片并保存到沙盒里
- 开发笔记 那些年追过的图片(十一)给图片加文字,加水印等
- 开发笔记 那些年追过的图片(五):imageView GIF 动画
- 开发笔记 那些年追过的图片(四):改变相册里的英文变成中文
- 开发笔记 那些年追过的图片(四):读取图片的信息
- 开发笔记 那些年追过的图片(九)图片转PDF的实现方法
- iOS开发备忘录:自定义UINavigationBar背景图片和Back按钮