iOS5 - twitter问题的sharekit [英] iOS5 - sharekit for twitter issue

查看:86
本文介绍了iOS5 - twitter问题的sharekit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只在iOS5的sharekit中遇到键盘问题。而是将文本内容发布到Twitter。

I am facing keyboard issue in sharekit for iOS5 only.While posting text content to twitter.

。我附上了我面临问题的屏幕截图
1.取消按钮不工作
2.Keyboard并没有消失。

.I have attached the screenshot for the screen in which I am facing the issues 1.Cancel button is not working 2.Keyboard is not disappearing.

如果有人解决了这个问题,请帮助我。

If any one has fixed the issue please help me.

推荐答案

编辑:


修复问题#254 - IOS 5取消按钮修复问题
https://github.com/ideashower/ShareKit/issues/254

在iOS 5中,模态呈现的视图控制器有一个nil
的parentViewController,而演示者则是
presentsViewController。更改了使用parentViewController检查iOS 5选择器以解除视图
的尝试,并且
使用它(如果可用)。

In iOS 5, a modally presented view controller has a nil parentViewController, and instead the presenter is presentingViewController. Changed the attempts to dismiss the view using the parentViewController to check for the iOS 5 selector, and used it if available.

所以获取最新的ShareKit。

So get the latest ShareKit.

编辑2:

我建议使用TWTweetComposeViewController如果该设备具有iOS 5.

I recommend to use TWTweetComposeViewController if the device has iOS 5.

Class TWTweetComposeViewControllerClass = NSClassFromString(@"TWTweetComposeViewController");

     if (TWTweetComposeViewControllerClass != nil) {
          if([TWTweetComposeViewControllerClass respondsToSelector:@selector(canSendTweet)]) {
              UIViewController *twitterViewController = [[TWTweetComposeViewControllerClass alloc] init];

              [twitterViewController performSelector:@selector(setInitialText:) 
                                          withObject:NSLocalizedString(@"TwitterMessage", @"")];
              [twitterViewController performSelector:@selector(addURL:) 
                                          withObject:url];

               [twitterViewController performSelector:@selector(addImage:) 
                                           withObject:[UIImage imageNamed:@"yourImage.png"]];
                [self.navigationController presentModalViewController:twitterViewController animated:YES];
                [twitterViewController release];
                }
            } else {
                [SHK flushOfflineQueue];
                SHKItem *item = [SHKItem URL:url title:NSLocalizedString(@"TwitterMessage", @"")];

                // Get the ShareKit action sheet
                SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];

                // Display the action sheet
                [actionSheet showInView:[self.view superview].window];
            }

添加h文件

#if defined(__IPHONE_5_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_5_0
#import <Twitter/Twitter.h>
#import <Accounts/Accounts.h>
#endif

并将Twitter框架和帐户添加为可选库。

And add the Twitter framework and Accounts as optional Libraries.

这篇关于iOS5 - twitter问题的sharekit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆