简体   繁体   中英

Non-Animated scroll WKInterfaceTable to bottom

I am building a iMessage-type application for the apple watch and am trying to figure out a way to keep the table pinned to the bottom. I have been trying to write a 'scroll to bottom' method that looks like this to keep the table pinned to the bottom after inserting rows, but it is animated and I need something that is not animated. Is there any way to accomplish something like this on the apple watch?

- (void)scrollToBottom {
    NSUInteger count = self.fetchedResultsController.fetchedObjects.count - 1;
    [self.interfaceTable scrollToRowAtIndex:count];
}

From my experience and research it is not possible with watchOS SDK 1. I don't know about watchOS SDK 2.

A workaround would be to only load a few messages (about five of them), then scroll to bottom after the messages are displayed. If only a few messages are loaded and shown, the scroll is not too bothering.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM