草庐IT

Today-Widget

全部标签

ios - Today Extension (Widget) 中可以使用 NSTimer 吗?

我想在TodayExtension中使用NSTimer来刷新小部件,但我不知道这种行为是否合法?我做了一个演示,使用NSTimer每1秒计数和刷新一次小部件UI,看起来好像可以,但问题是当用户退出通知中心时,计时器仍在运行,我应该何时何地停止计时器? 最佳答案 我也可以确认这种方法对我很有效。overridefuncviewDidDisappear(animated:Bool){//stopthetimerherewhennotificationcenterisclosed}有趣的是,当您开始向上滑动关闭通知中心时,viewWill

ios - Core Data iOS 8 Today Widget 问题

我有一个返回共享实例的DataManager类:+(DataManager*)sharedInstance;{staticDataManager*sharedInstance=nil;staticdispatch_once_tpred;dispatch_once(&pred,^{sharedInstance=[[DataManageralloc]init];});returnsharedInstance;}在这里我跟踪我的managedObjectContext、managedObjectModel、persistentStoreCoordinator。我还有一个方法,我可以拉出要显示

ios - Today Extension 中的 UITableView 未收到行点击

我有一个带有TodayExtension的iOS8应用程序。该扩展程序中有一个UITableView,并且可以正确呈现。但是,似乎无法可靠地调用didSelectRowAtIndexPath。我猜这是因为通知中心是一个UIScrollView并且在其中嵌入一个UITableView会导致一些问题,但我不确定。有谁知道可能导致此问题的原因是什么? 最佳答案 解决方法:将不透明度设置为0.01,如下所示:self.view.backgroundColor=[UIColorcolorWithWhite:1alpha:0.01];

ios - xctool 使用 today 扩展构建

我们有一个与todayextension集成的应用程序,我们使用xctool和Jenkins进行持续构建和内部分发。在命令行中,在我们使用之前xctool-workspaceour_workspace.xcworkspace-schemeapp_schme-xcconfigpath_to_xcconfig-configurationReleasebuildarchive-archivePathpath_to_archive生成存档然后导出到.ipa,它工作正常。但是现在有了今天的扩展,我们必须用另一个方案和xcconfig来构建它,我们将证书和配置文件放在xcconfig中,因为今天的

iOS Today 扩展 TableView 行仅检测标签上的点击

我在使用iOS上的今日小部件时遇到了最奇怪的问题。我有一个简单的小部件,带有这样的表格View:https://grab.edr.io/2e557aa43a34b7460b1eac44cbcaf596.png问题是,当我点击其中一个标签时它只会响应触摸(行只会突出显示),而不是行的其余部分(空白)。这在设备和模拟器上都会发生。我正在使用tableView:didSelectRowAtIndexPath:检测触摸,所以我看不到那里的问题。这是我的Storyboard的屏幕截图:https://grab.edr.io/c2dc09db20ded2b471dc94ea339141b8.png

android - java.lang.NoSuchMethodError : No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)

将我的AndroidStudio更新到3.0后,我收到NostaticmethodgetFont()错误。我正在从事的项目在github上,https://github.com/ik024/GithubBrowser//Top-levelbuildfilewhereyoucanaddconfigurationoptionscommontoallsub-projects/modules.buildscript{repositories{jcenter()maven{url"https://oss.sonatype.org/content/repositories/snapshots"}}

android - java.lang.NoSuchMethodError : No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)

将我的AndroidStudio更新到3.0后,我收到NostaticmethodgetFont()错误。我正在从事的项目在github上,https://github.com/ik024/GithubBrowser//Top-levelbuildfilewhereyoucanaddconfigurationoptionscommontoallsub-projects/modules.buildscript{repositories{jcenter()maven{url"https://oss.sonatype.org/content/repositories/snapshots"}}

iOS Today Extension - 共享核心数据

我有一个使用核心数据的应用程序,我正在尝试向它添加一个today扩展程序,它也可以访问数据到目前为止我已经设置好它并且能够访问数据,但是我在处理实体的类时遇到了问题。我收到以下错误CoreData:warning:Unabletoloadclassnamed'Med_Track_2.Medicine'forentity'Medicine'Med_Track_2是主应用程序的产品名称,Medicine_Tracker_2是扩展程序的名称医学类被添加到两个目标有解决办法吗? 最佳答案 您必须在您的应用程序和您的扩展程序之间共享资源。阅读

ios - iOS 8 Today 扩展中的拖动手势

我在我的Today小部件中使用UIView子类。该View使用滑动手势。然而,这些手势要么上下滚动整个通知中心,要么使通知中心从今天切换到通知。有什么方法可以防止触摸事件冒泡到通知中心ScrollView吗?不幸的是,在子类中使用[selfsetExclusiveTouch:YES];没有解决。 最佳答案 IsthereanywaytopreventthetoucheventstobebubbleduptotheNotificationCenterscrollview?Using[selfsetExclusiveTouch:YES]

ios - Today Widget 中的自定义字体 iOS 总是返回 nil

我试图将自定义字体添加到我今天的扩展中,但UIFont总是返回nil。步骤:我将字体文件添加到TodayWidget目标:我检查字体文件是否在TodayWidget包中:我在TodayWidget的TodayViewController中初始化字体实例,但它总是返回nil:-(void)viewDidLoad{[superviewDidLoad];UIFont*ft=[UIFontfontWithName:@"octicons-local"size:20];}我在我的主项目中使用了同样的方法,我可以得到自定义字体。我该如何解决? 最佳答案