1

我正在使用社交框架在我的应用程序中添加 Twitter,如果用户没有登录 Twitter 帐户,我会显示打开设置登录 Twitter 的警报,但同时键盘也出现了,谁能帮助我如何停止键盘出现当时。

我正在使用以下代码获取警报视图以连接设置

// Set up the built-in twitter composition view controller.
TWTweetComposeViewController *tweetViewController = [[TWTweetComposeViewController alloc] init];

// Create the completion handler block.
[tweetViewController setCompletionHandler:^(TWTweetComposeViewControllerResult result) {
    [delegate dismissModalViewControllerAnimated:YES];
}];

// Present the tweet composition view controller modally.
[delegate presentModalViewController:tweetViewController animated:YES];
//tweetViewController.view.hidden = YES;
for (UIView *view in tweetViewController.view.subviews){
    [view removeFromSuperview];
}

提前致谢。

4

1 回答 1

0

试试这个代码:

TWTweetComposeViewController *twitterViewController = [[TWTweetComposeViewController alloc] init];

[self presentViewController:twitterViewController animated:YES completion:nil];

twitterViewController.completionHandler = ^(TWTweetComposeViewControllerResult twResult) {
    switch(twResult) {
        case TWTweetComposeViewControllerResultDone:
            break;
        case TWTweetComposeViewControllerResultCancelled:
            break;
    }

    dispatch_async(dispatch_get_main_queue(), ^{
        [self dismissViewControllerAnimated:NO completion:nil];
    });
};
于 2013-04-23T17:51:19.457 回答