问题标签 [wkinterfacetable]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
swift - 按顺序观看 OS Swift Table 加载数据
Watch OS 3/Xcode 8 允许独立的手表应用程序。有人可以提供最好的 Swift 数组/方法,以便从接口控制器按顺序将数据加载到 storbyboard 中的表中,并在每次显示后更新。
我的代码现在只选择第一个值并显示在表格中,使用后不会移动到表格列表中的下一个值。
watchkit - 更改 WKInterfaceTable 单元格类型
我需要在我的 WatchKit 应用程序中显示三种不同类型的单元格。基本上是一个多线程报告结果,两个单线程报告错误或等待旋转。我通过使用各种 setNumberOfRows 和 setRowTypes 进行反复试验,偶尔会发生崩溃,或者相反无法显示所需的数据并且不太理解为什么会发生这些事情。Apple 在描述中非常吝啬,只是说当你只有一个类型时使用 setNumberOfRows,而当你有多个类型时使用 setRowTypes。相反,对于如何更改表格的类型内容,以及在 iOS 上使用 reloadData 会做什么,她完全保持沉默。如何以最佳方式更改表中行类型的组成?
swift - WKInterfaceLabel Attributed String Fails on Width
I am using an attributed string to strikethrough text in a WKInterfaceLabel
. This works up until the point where the text is longer than the width of the watch and therefore you see ...
Actually the same thing happens on iOS; however, you can clip content which resolves the issue. On the watch, clipping is not available.
How can I strikethrough the visible text when the overall width is beyond the screen's bounds? Below is the code:
ios - 在 WKInterface Table + Objective c 中重新加载数据
我正在开发手表套件应用程序。在这里,我想突出显示表格中的选定行。我的问题是当我选择行时,添加到行的图像再次下载,或者您可以说该列表闪烁。我只想要我选择更新的行。
watchkit - WKInterfaceTable 获取滚动位置(contentOffset.y)
在UITableView
我可以调用tableView.contentOffset.y;
以获取用户滚动的位置。但是,WatchKitWKInterfaceTable
不支持这一点。有什么办法可以得到滚动位置WKInterfaceTable
?
用例为什么这是必要的:
- 用户在桌子中间
- 表更新
- 表格滚动跳到顶部
- 用户必须再次向下滚动
我能够以编程方式向下滚动,self.messageTableOutlet.scrollToRow(at: (size-1)
但用户并不总是希望被扔到表格的末尾。他也不想登顶,他只想呆在那里。
swift - 设置 setNumberRows 是否取消分配不需要的行?
我WKInterfaceTable
在 WatchOS 上使用。
例如,如果表已经有5 行,
和我
.setNumberOfRows(2, withRowType: "rows")
所以它现在只有2 行,
这是否意味着不再可见的 3 行被释放
(或者我必须跑去apptTable.removeRows
取消分配)?
谢谢
watchkit - 如何解除使用 contextForSegue 呈现的 WKInterfaceController?
我有一个WKInterfaceController
with a WKInterfaceTable
,其中列出了用户在我的应用程序中记录的一些事件。
用户可以点击表格的一行以查看有关该事件的更多详细信息。为了实现这一点,我已经覆盖contextForSegue(withIdentifier:in:rowIndex:)
了WKInterfaceController
包含表格的 ,因此点击一行以模态方式在新的WKInterfaceController
名为EventDetailController
.
modal
演示文稿在故事板上定义。我不能使用push
演示文稿,因为WKInterfaceController
with是我的应用程序顶层WKInterfaceTable
多个实例中的一个页面。WKInterfaceController
这是主要问题:
在 中EventDetailController
,有一个删除按钮来销毁表格行所代表的记录。
当用户点击删除按钮时,我会显示一个警报,允许用户确认或取消删除操作。
一旦用户确认删除记录,我想关闭EventDetailController
它,因为它不再相关,因为它代表已删除的记录。
这是点击删除按钮时调用的IBAction
定义:EventDetailController
问题是 watchOS 似乎不允许这样做。测试此代码时,EventDetailController
不会关闭。相反,控制台中会记录一条错误消息:
[WKInterfaceController dismissController]:434: calling dismissController from a WKAlertAction's handler is not valid. Called on <Watch_Extension.EventDetailController: 0x7d1cdb90>. Ignoring
我尝试了一些奇怪的变通方法来试图诱使他们EventDetailController
解除,例如在事件被删除时触发通知并EventDetailController
从通知观察者调用的函数中解除通知,但这也不起作用。
在这一点上,我在想有一些正确的方法我应该能够关闭 a WKInterfaceController
,或者换句话说,反转contextForSegue(withIdentifier:in:rowIndex:)
呼叫,但我不知道它是什么。
当我dismiss()
直接在IBAction
, 而不是在WKAlertAction
处理程序中调用时,它可以正常工作,但我不喜欢这种实现,因为它不允许用户先确认操作。