Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fixed-size table in iOS WatchKit

What i want to achieve is to have a "Header label" that is always visible on the top, a table in the middle which can have multiple items and its scrollable, and two buttons "Left" and "Right" which are always visible on the bottom.
Example:

enter image description here

To achieve this i add the table in a fix sized group, but this way the table is not scrollable.

If i add the table without a group, then the whole screen becomes scrollable which doesn't solve my problem.
Example:

enter image description here

Is this even possible with the current API?

like image 342
Jovan Jovanovski Avatar asked Feb 02 '15 14:02

Jovan Jovanovski


1 Answers

TL;DR

If you want scrollable table inside group use size to fit content in group settings but probably it won't behave as you want.

Details

First of all currently (2nd February 2015) it's not possible to have some elements static and some of them dynamic in one InterfaceController. If you have scrollable content (like table) all elements on this InterfaceController will be scrollable.

So, you can use solution from TL;DR section but as I said it probably won't behave as you want. I had similar problem: to set image as static background table but didn't manage to solve it, even if you set image as table background it won't be static.

Note

From Apple's Human Interface Guidelines

Do not embed tables inside groups. Tables resize dynamically based on the number of rows they contain. As a result, tables ignore any height restrictions placed on them by groups. (https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/WatchHumanInterfaceGuidelines/Tables.html#//apple_ref/doc/uid/TP40014992-CH24-SW1)

like image 106
lvp Avatar answered Oct 03 '22 16:10

lvp