【发布时间】:2014-06-09 06:45:56
【问题描述】:
我使用 Xcode 6 创建了一个扩展程序,实际上是一个 Today Widget,并在我的 iOS 8 beta 设备上运行它(我是一名注册的 iOS 开发人员)。
但是,作为开发新手,我遇到了这个问题,SLComposeViewController 被“卡”在其视图中(如下所示),认为用户无法与其交互,因此无法发布一条推文。
有没有办法解决这个问题并将SLComposeViewController 放在前面,在通知中心窗格的前面?任何帮助将不胜感激。
编辑:(耶,修复了“Hello World”文本)
第二次编辑:这是我的SLComposeViewController 代码:
- (IBAction)TwitterShare:(id)sender; {
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewController *tweetSheet = [SLComposeViewController
composeViewControllerForServiceType:SLServiceTypeTwitter];
[self presentViewController:tweetSheet animated:YES completion:nil];
}
else
{
UIAlertView *twitterAlert = [[UIAlertView alloc] initWithTitle:@"Uh oh!" message:@"Ensure you have setup a valid Twitter account and/or you have allowed access for Twitter in this application." delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
[twitterAlert show];
twitterAlert = nil;
}
}
【问题讨论】:
-
你能分享你的 SLComposeViewController 代码吗?
-
如上共享,任何帮助都会很棒!
-
仅供参考 IIRC,您不能使用 Today 扩展中的键盘。让我试着找到这方面的参考。
-
找到了。来自App Extensions Programming Guide:“由于用户与小部件的交互快速且有限,因此您应该设计一个简单、流线型的 UI,突出用户感兴趣的信息。一般来说,限制交互项目的数量是一个好主意。小部件。特别是,请注意,iOS 小部件不支持键盘输入。"
-
看来你真的需要adjust the height
标签: ios objective-c ios8 ios-app-extension today-extension