Need Help With WKInterfaceTable

i am using WKInterfaceTable. in Table's Group I have label with heigth set dynamic. when Table's Group set height sizeToFit Content. scrollToRowAtIndex method not working properly


anyone help me.


Thanks.

Yeah seems like a bug. For example if the code is this:


//
// Pre: Interface builder set
//   table row's group
//     height == Size To Fit Content
//   label inside table row's group is
//     Lines == 0
//     Size Width == Size To Fit Content
//     Size Height == Size To Fit Content

// Assuming table is populated with this
self.myData = @[@"0",
                @"1 is something that should span 1 line",
                @"2 some more long text that spans",
                @"3",
                @"4",
                @"5",
                @"6",
                @"7",
                @"8",
                @"9",
                @"10 some additional long text that is loooong!"];

// scrolling to 9th item does not show 9th item but barely shows "7" cut off at bottom of screen
[self.myTableView scrollToRowAtIndex:9];



Will result in a table that barely scrolls to the "7" instead of "9".

Are you going to file a bug? If not, I can...

I saw this behaviour when I was developing a watchOS 1 app. Using dispatch_async to delay the call to scrollToRowAtIndex to the next run loop worked for me.


dispatch_async(dispatch_get_main_queue(), ^{
    [self.table scrollToRowAtIndex:MIN(self.indexOfFirstStepNotYetStarted, numCookingSteps - 1)];
});

Hi,


I've recently bumped with this problem and got some interesting conclusions, hope it might still be of help 🙂


I was trying desperately to get a table to scroll to the last index by passing either a) the table numberOfRows b) something I was sure it was bigger than the table size but it wasn't working, the table wasn't scrolling! I was doing this because the documentation clearly states: "Specifying an index greater than the total number of row controllers scrolls to the bottom of the list."

The minute I've tried to use the real last index, the table scrolled smoothly...


Bottom line, I think the bug is in the documentation 😀


Cheers,

Need Help With WKInterfaceTable
 
 
Q