wkinterfacetable

Apple Watch Table - first 4 rows not appearing

我的梦境 提交于 2020-01-22 20:54:28
问题 I'm having problems adding rows to WKInterfaceTable on Apple Watch. The weird thing is that no matter what I do, the first 4 rows appear as empty. I tried adding rows manually and in a loop - doesn't matter. I believe my code is good because 5th and further rows appear just fine. Here's what happens: Scroll further: My code: import Foundation import WatchKit class TableInterfaceController: WKInterfaceController{ @IBOutlet weak var agentTable: WKInterfaceTable! let agents = ["The Dude","Walter

Change color of row programmatically in WatchKit

你离开我真会死。 提交于 2019-12-24 03:46:17
问题 I'd like to change the color of a row in a WKInterfaceTable if it has been selected. I've done these steps but don't know how I can go further: override func table(table: WKInterfaceTable, didSelectRowAtIndex rowIndex: Int) { let row = tableView.rowControllerAtIndex(rowIndex) as! TableRowObject } I hope someone of you guys can help me to do this. 回答1: You can change colour as per row selection, Create IBOutlet of WKInterfaceGroup in rowController and set it to Storyboard with DefaultGroup

WKInterfaceTable rendering issues. Both the scroll bar and last row are cut off

久未见 提交于 2019-12-11 11:43:28
问题 I'm developing a WatchKit app for the Apple Watch. I "finished" the app originally when the first beta was out back in Nov/Dec. I recently upgraded the the final release and somethings in WatchKit changed (as to be expected). I had to fix couple lines of code here and there since they changed how the app views start up. Anyway, after fixing the issues I noticed that my WKInterfaceTable displays and scrolls almost correctly. The last row in the table gets cut off (as indicated in the

WKInterfaceTable inside WKInterfaceGroup with static BG image behind?

半腔热情 提交于 2019-12-11 01:29:56
问题 I’m trying to display a static background image behind a scrolling WKInterfaceTable , that could contain one or more rows. I’m trying to do this by placing the table inside a WKInterfaceGroup , and setting that group’s background image. The issue is that if I set the group’s height to “Size to fit content”, the table will not scroll, and if I set the group’s height to “Relative to container”, the image does not take up the full display if there is only one row. Is there a clever way around

How to create sections in WKInterfaceTable

☆樱花仙子☆ 提交于 2019-12-03 12:52:24
问题 How can we create sections in table as there is no delegate for it. And is there any other way for creating sections or do we have to use two tables. 回答1: WKInterfaceTable is not so flexible like UITableView, but you can create rows manually, using different row types. And fill content for each cell according to its type. Take a look at the documentation: Apple Watch Programming Guide: Tables WatchKit Framework Reference: WKInterfaceTable For example, let's create a table having two row types

How to create sections in WKInterfaceTable

浪尽此生 提交于 2019-12-03 03:16:10
How can we create sections in table as there is no delegate for it. And is there any other way for creating sections or do we have to use two tables. WKInterfaceTable is not so flexible like UITableView, but you can create rows manually, using different row types. And fill content for each cell according to its type. See documentation: Apple Watch Programming Guide: Tables WatchKit Framework Reference: WKInterfaceTable For example, let's create table with two row types: headerRowType detailRowType #define type1 @"HeaderRowType" #define type2 @"DetailRowType" // You also must create two classes