Change SLComposeSheetConfigurationItem color / text color

So, over the past two weeks I have been working on my GitHub repository https://github.com/satheeshwaran/iOS-8-Features-Demo , where I tried to demonstrate the advanced Share extension in iOS 8. I learned how to add SLComposeSheetConfigurationItemto SLComposeServiceViewController, but I was not able to figure out how to change the hue color or text color SLComposeSheetConfigurationItem.

What have I done so far

enter image description here

See the picture above. I would like to set the description and My First Share to any color of my choice, maybe also I would like to customize the font or something else. I fell into SocialFramework a bit , but couldn't get anything out of it.

I saw the Evernote extension on my iPad and it looks like this enter image description here

, , .. .

WWDC 2014 ,

SLComposeServiceViewController
UI/NSViewController ,

  • SLComposeServiceViewController SLComposeSheetConfigurationItem, ?
  • , SLComposeServiceViewController ? UIViewController .
  • Evernote UIViewController, SLComposeServiceViewController ( , , ).
+4
3

. , .

[[[self navigationController] navigationBar] setTintColor:[UIColor whiteColor]];
[[[self navigationController] navigationBar] setBackgroundColor:[UIColor redColor]];
[[self navigationItem] setTitleView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"elephant.png"]]];

SLComposeSheetConfigurationItem, , .

SLComposeSheetConfigurationItem @property (nonatomic, copy) NSString *title; // The displayed name of the option. @property (nonatomic, copy) NSString *value; // The current value/setting of the option. @property (nonatomic, assign) BOOL valuePending; // Default is NO. set to YES to show a progress indicator. Can be used with a value too.

+6

, , Evernote:

func getTopWithColor(color: UIColor, size: CGSize) -> UIImage {
    let rect = CGRectMake(0, 0, size.width, size.height)
    UIGraphicsBeginImageContextWithOptions(size, false, 0)
    color.setFill()
    UIRectFill(rect)
    if let img = UIImage(named: "icon.png") {
        img.drawInRect(CGRectMake((size.width-size.height)/2, 0, size.height, size.height))
    }
    let image: UIImage = UIGraphicsGetImageFromCurrentImageContext()
    UIGraphicsEndImageContext()
    return image
}

override func viewDidLoad() {
    super.viewDidLoad()

    self.navigationController?.navigationBar.tintColor = UIColor.blackColor()
    let navSize = self.navigationController?.navigationBar.frame.size
    self.navigationController?.navigationBar.setBackgroundImage(getTopWithColor(UIColor.whiteColor(), size: navSize!), forBarMetrics: .Default)
}

SLComposeServiceViewController with custom navigation bar

+4

SLComposeServiceViewController SLSheetNavigationController, , , , .

+1

All Articles