Disclaimer: I realize this may not be approved by Apple, and I realize traversing the view hierarchy is programmatically unsafe. I'm trying to figure it out for my own curiosity :)
I'd like to change the case of a UIImagePickerController's navigation bar items.
This works for the title text:
viewController.navigationItem.title = [viewController.navigationItem.title uppercaseString];
But this doesn't work for the cancel button (clearly it's not the right location for the cancel button, but I can't find it in the view hierarchy).
How can I change the cancel button too?
[viewController.navigationItem.rightBarButtonItems enumerateObjectsUsingBlock:^(UIBarButtonItem* btn, NSUInteger idx, BOOL *stop) {
btn.title = [btn.title lowercaseString];
}];
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…