0 Replies
      Latest reply on Jun 12, 2019 6:13 AM by funkenstrahlen
      funkenstrahlen Level 1 Level 1 (0 points)

        I use a very basic WKInterfaceTable in my WatchKit based app. It displays multiple rows which contain two labels. The labels can have varying length content therefore the rows have to scale accordingly with the content. This works perfectly in the simulator. On device it works correctly most of the time, but somtimes the rows do not scale correctly with the content like demonstrated in these screenshots: https://imgur.com/a/Cjylq65

         

        This leads to clipping content of the labels. I see this happening in watchOS 4 and watchOS 5 on different Apple Watch models. I see this issue only in this special WKInterfaceTable, never seen it in any other views of my app.

         

        I configure the WKInterfaceTable like this:

         

        import WatchKit
        import Foundation
        import PollenflugShared_watchOS
        
        class DayDetailInterfaceController: WKInterfaceController {
            
            @IBOutlet var table: WKInterfaceTable!
        
            override func awake(withContext context: Any?) {
                super.awake(withContext: context)
                
                guard let day = context as? ForecastDay else { return }
                guard let data = PollenKit.shared.loadDataFromCache() else { return }
                guard let region = PollenKit.shared.userRegionFrom(pollenflug: data) else { return }
                
                setTitle(day.localizedString)
                
                // sort user allergenes by name
                let allergenes = User.allergenes.sorted()
                
                table.setRowTypes(["allergeneRow"])
                table.setNumberOfRows(allergenes.count, withRowType: "allergeneRow")
                for index in 0..            if let rowController = table.rowController(at: index) as? PollenflugDetailRowController {
                        let allergene = allergenes[index]
                        var score = PollenKit.shared.scoreFor(region: region, allergene: allergene, day: day)
                        if score == nil  {
                            score = Score.init(score: -1)
                        }
                        rowController.allergeneLabel.setText(allergene.localizedString)
                        rowController.warningLevelLabel.setText(score?.localizedDescription)
                        rowController.warningLevelLabel.setTextColor(score?.color)
                    }
                }
            }
        
        }
        
        

         

        Has anyone ever seen this issue? I am really out of ideas what I am doing wrong.