Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>iOS 5.0 introduced some appearance customization options for <code>UISegmentedControl</code>. I think the method you'd be most interested in is:</p> <pre><code>- (void)setTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state </code></pre> <blockquote> <p><strong>Discussion</strong><br> The attributes dictionary can specify the font, text color, text shadow color, and text shadow offset for the title in the text attributes dictionary, using the keys in NSString UIKit Additions Reference.</p> </blockquote> <h1>Update</h1> <p>If you're creating your UISegmentedControl programmatically, you can just go ahead and call this method right after you create it. If you're loading from a nib, you'll have to set it as an outlet and call this method in your <code>awakeFromNib</code> or <code>viewDidLoad</code> method.</p> <p>Now, your "Please tap the appropriate button" text is in the navigation prompt? I'm not sure if you can modify the look of that. Perhaps you could do some trickery...</p> <ul> <li>Set <code>self.navigationItem.prompt = @" ";</code> so it's technically set but doesn't have anything to display.</li> <li>Make a <code>UIView</code>, add your <code>UISegmentedControl</code> to that, as well as a <code>UILabel</code> that you style the way you want with the <code>frame.origin.y = -20.0</code> or so. Then, set that view to <code>self.navigationItem.titleView</code>. Make sure you set <code>clipsToBounds = NO</code> and <code>backgroundColor = [UIColor clearColor]</code>.</li> </ul> <p>That way, it should display the segmented control with your custom label over it, theoretically at least. Let me know how this turns out.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload