• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Segmented Control Appearance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Segmented Control Appearance


  • Subject: Segmented Control Appearance
  • From: David Delmonte <email@hidden>
  • Date: Wed, 28 Mar 2012 20:52:06 -0400

I'm building an app for iOS 5.x and am trying to use the new UIAppearance capability.

I want to style a UISegmented Control title as follows:

	UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:segments];
	segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
	segmentedControl.frame = CGRectMake(0, 0, 400, 30);
	[segmentedControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged];
	segmentedControl.momentary = YES;
	segmentedControl.backgroundColor = selectedTintColor;

	[[UISegmentedControl appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"Helvetica" size:20.0f], UITextAttributeFont, [UIColor whiteColor], UITextAttributeTextColor, nil]];

This compiles but throws this exception:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_UIAppearance setTitleTextAttributes:]: unrecognized selector sent to instance 0x7c957d20'


I would appreciate any help in understanding what I'm doing wrong..

Thanks!




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Segmented Control Appearance
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Re: Getting the best frame rate for NSView drawing
  • Next by Date: Re: Can't delete file on device
  • Previous by thread: Re: NSTextFinder: endless loops asking for string at index that doesn't exist.
  • Next by thread: Re: Segmented Control Appearance
  • Index(es):
    • Date
    • Thread