How to remove statusbar from messageviewcontroller?

Posted by hckr on Stack Overflow See other posts from Stack Overflow or by hckr
Published on 2012-12-03T10:59:30Z Indexed on 2012/12/03 11:07 UTC
Read the original article Hit count: 166

Filed under:

I am sending sms programmatically from my view controller but now it is showing me statusbar and vertical black line

my code:

- (IBAction)SendTextBtnTapped:(id)sender {
    [self sendSMS:@"Body of SMS..." recipientList:[NSArray arrayWithObjects: nil]];
}


- (void)sendSMS:(NSString *)bodyOfMessage recipientList:(NSArray *)recipients
{
    MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
    if([MFMessageComposeViewController canSendText])
    {
        controller.body = bodyOfMessage;    
        controller.recipients = recipients;
        controller.messageComposeDelegate = self;
        [self presentModalViewController:controller animated:YES];
    }    
}

- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
{
    [self dismissModalViewControllerAnimated:YES];

    if (result == MessageComposeResultCancelled)
        NSLog(@"Message cancelled");
    else if (result == MessageComposeResultSent)
        NSLog(@"Message sent");  
    else 
        NSLog(@"Message failed");
}

and my screen look like this:

enter image description here

© Stack Overflow or respective owner

Related posts about ios