Когда вы вызываете следующий метод twitter
, я всегда получаю странный отступ сверху.TWTweetComposeViewController странный отступ сверху
Вот мой метод:
- (void)twitter {
if ([TWRequest class]) {
TWTweetComposeViewController *twitter = [[TWTweetComposeViewController alloc] init];
[twitter setInitialText:titleDetail];
[twitter addImage:imgPreview];
[twitter addURL:[NSURL URLWithString:linkPost]];
[self presentViewController:twitter animated:YES completion:nil];
twitter.completionHandler = ^(TWTweetComposeViewControllerResult res) {
if (res == TWTweetComposeViewControllerResultDone) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Выполнено" message:@"Ваш твит успешно опубликован" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
} else if (res == TWTweetComposeViewControllerResultCancelled) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Ошибка" message:@"Ваш твит неопубликован" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}
[self dismissModalViewControllerAnimated:YES];
};
}
}
Как это исправить?
Обновление: FIXED
Проблема заключалась в следующем: При загрузке приложения (который отображает экран заставки) Я скрыть строку состояния.
Строка состояния изначально скрыта.
А потом, в AppDelegate.m
:
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO];
[UIApplication sharedApplication].keyWindow.frame = CGRectMake(0, 20, 320, 460);
Проблема была именно в 20
:
CGRectMake (0, 20, 320, 460);
Это нормально, чтобы ответить на свой вопрос; на самом деле, пожалуйста, сделайте это, вместо того, чтобы оставить этот вопрос без ответа. – benzado