UIKeyboardAppearanceDark
with SLComposeViewController
?The SLComposeViewController
class presents a view to the user to compose a post for supported social networking services.
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[self presentViewController:controller
animated:YES
completion:nil];
SLComposeViewController Class Reference
Ugly!
This is how the light keyboard looks with a dark background:
Mockup!
This is how the dark keyboard looks with a dark background:
I have tried a few methods. The only way that I found working is to customize the entire ComposeViewController. I also believe it is the only possible way.
I found an open source project calls REComposeViewController and I customized it to have UIKeyboardAppearanceDark by default. I have uploaded to Github you can download and play with it.
Project: https://github.com/voyage11/SLComposeViewControllerWithBlackKeyboard
Attached Screen shot:-
After carefully understanding the problem you are facing and doing some R&D, I'm suggest you to go for Custom ComposeViewController
, because you can't change the keyboardAppearance
of ComposeViewController's
keyboard.
For implementing Customize ComposeViewController
follow the below steps:
1) Made some custom view like SLComposeViewController's
View.
2) On the post button you need to implement the logic in SLComposeViewControllerResultDone
[_shareComposerSheet setCompletionHandler:^(SLComposeViewControllerResult result)
{
switch (result)
{
case SLComposeViewControllerResultCancelled:
break;
case SLComposeViewControllerResultDone:
{
}
break;
default:
break;
}
}];
3) And when you wants to show your custom view, make sure that the textView you are using in the custom view must be assign keyboardAppearance's
property to UIKeyboardAppearanceDark
self.yourTextField.keyboardAppearance = UIKeyboardAppearanceDark;
Below is the picture of customize view, that I implemented in a my recent project.
Hopefully it will helps you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With