If you want to use a custom image in UIBarButtonItem, you can use this code.
DoneButton = [[UIBarButtonItem alloc] initWithTitle:[Settings getConfigurableLabel:GENERAL_DONE] style:UIBarButtonItemStyleBordered target:self action:@selector(btnWorkOrderDoneClicked)]; UIButton *cameraButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 20.0f, 20.0f)]; UIImage *cameraImage = [UIImage imageNamed:@"cameraicon_white.png"]; [cameraButton setBackgroundImage:cameraImage forState:UIControlStateNormal]; [cameraButton addTarget:self action:@selector(openCamera) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem* cameraButtonItem = [[UIBarButtonItem alloc] initWithCustomView:cameraButton];
var.onur
source share