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 に答える