First: Implement Navigationcontroller agent
-(void) Navigationcontroller: (uinavigationcontroller *) Navigationcontroller Willshowviewcontroller: (uiviewcontroller *) Viewcontroller animated: (BOOL) animated
{
UIButton *cusbtn = [[UIButton alloc]initwithframe:cgrectmake(0, 0, (+)];
[Cusbtn settitle:@ " cancel " forstate:(uicontrolstatenormal)];
Cusbtn. backgroundcolor = [uicolor redcolor];
[Cusbtn addTarget:self action:@selector(click) forcontrolevents:( uicontroleventtouchupinside)];
uibarbuttonitem *btn = [[uibarbuttonitem alloc] initwithcustomview: cusbtn];
[Viewcontroller. Navigationitem setrightbarbuttonitem: btn animated:NO];
}
Second: Implement the click Method to complete; Imagepicker as a weak reference
@property (nonatomic, weak) Uiimagepickercontroller *imagepicker;
-(void) click{
[self imagepickercontrollerdidcancel:self. Imagepicker];
}
Change the cancle of the system camera Uiimagepickercontroller navigation bar to the Cancel button