0

I've this strange issue when i'm presenting a MFMessageComposeViewController in my app!

I don't know what this black bar is and i'm unable to remove the app logo from the NavigationBar.

The MessageCompose view controller draws over my nav bar

And here is the code for presenting the controller

MFMessageComposeViewController *messageController = [[MFMessageComposeViewController alloc] init];
[[messageController navigationBar] setBarTintColor:SMAN_ORANGE_COLOR];
[[messageController navigationBar] setTintColor:[UIColor whiteColor]];
messageController.messageComposeDelegate = self;
[messageController setRecipients:recipents];
[messageController setBody:message];

// Present message view controller on screen
[self presentViewController:messageController animated:YES completion:nil];
javal88
  • 1,188
  • 3
  • 17
  • 29

4 Answers4

1

To remove the app logo, try to add in your method above the following code:

messageController.navigationItem.titleView = [UIImageView new];

To change the Status Bar style (White Color) add the following code before presenting the messageController:

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];

Also in your .plist file set:

View controller-based status bar appearance to NO

0

I solve the issue subclassing my UINavigationController and changing the appearance of it with [UINavigationBar appearanceWhenContainedIn:[myNavControllerSubclass class], nil]

javal88
  • 1,188
  • 3
  • 17
  • 29
0
   [self presentViewController:messageController animated:YES completion:^{
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO];
}];

this works in ios 8 for the white status bar

Refer answer #1 also.

JohnHanr
  • 223
  • 2
  • 12
-1

As per Apple's documentation you can only present it modally.

[self presentModalViewController:messageController animated:YES];
Andrei Filip
  • 1,145
  • 15
  • 33