1
當你調用下面的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];
};
}
}
我該如何解決這個問題?
更新:修正
的問題是這樣的: 當應用程序負載(其中顯示一個閃屏)我隱藏狀態欄。
狀態欄最初是隱藏的。
然後,在AppDelegate.m
:
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO];
[UIApplication sharedApplication].keyWindow.frame = CGRectMake(0, 20, 320, 460);
的問題正是在20
:
CGRectMake (0, 20, 320, 460);
這是確定的回答你自己的問題;實際上,請這樣做,而不是讓這個問題看起來沒有答案。 – benzado 2012-03-21 19:31:47