I assume you have a class that implements the UIActionSheetDelegate protocol, and your class is the delegate class of the current UIActionSheet , so in this class you can change the whole UIActionSheet header like
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet { for (UIView *_currentView in actionSheet.subviews) { if ([_currentView isKindOfClass:[UILabel class]]) { [((UILabel *)_currentView) setFont:[UIFont boldSystemFontOfSize:15.f]]; } } }
but as you can see, you cannot format part of the UILabel object text property.
you can add a new UILabel for your actionsheet now with a different font if you want to see text with the offset line DO: ... but from here the limit is just your imagination, you can format the UIActionSheet elements in this method or inside the -didPresentActionSheet: method.
so there would be an idea for this .
UPDATE October 7, 2013
in iOS7, we actually do not have direct access to subviews of a UIAlertView or UIActionSheet , so this solution may not work properly in iOS7.
If you have problems with it on iOS7, comment on this to me! thank.
UPDATE June 22, 2014
I did not find any solution to do this directly with the new UIAlertController in iOS8, the title bar does not appear to be visible in the entire hierarchy of UIAlertController , not visible until it appears or even after.
NOTE. I also found out that it is not forbidden to overlap / close its contents, after that appears on the screen. it is currently not possible to predict that it will work on a beta version or whether it is safe for the AppStore.
NOTE. Please do not forget about the graph of the life cycle of the view and do not try to present any content in the view or view controller if it is not already in the navigation stack.
Anyway, here is the Swift solution, how I could reach the layers, and I could add my custom look to it.
let alertController: UIAlertController = UIAlertController(title: "", message: "", preferredStyle: UIAlertControllerStyle.Alert) self.presentViewController(alertController, animated: true, completion: { let aboveBlurLayer: UIView = alertController.view.subviews[0] as UIView let belowBlurLayer: UIView = (aboveBlurLayer.subviews[0].subviews as Array<AnyObject>)[0] as UIView let customView: UIView = UIView(frame: aboveBlurLayer.bounds) customView.backgroundColor = UIColor.redColor() aboveBlurLayer.addSubview(customView) })
NOTE. It might be useful to add custom content to the alert / action table, but if that doesn't work in the future, I will update my answer.