18

I want to remove the spacing between the rows in Table, is there any property for it?

Niko
  • 3,412
  • 26
  • 35
Mohit Totlani
  • 825
  • 1
  • 10
  • 21
  • Do you have an image of how you would like to have the table in order to know how can I help you to trick the interface? – EnriMR Apr 01 '15 at 11:41

8 Answers8

2
  • Select your table in StoryBoard

enter image description here

  • AttributeInspector and Check mark Spacing as Custom, Set it 1 (Set as per your requirement)

enter image description here

  • Run your app,
Slyvain
  • 1,732
  • 3
  • 23
  • 27
1

I haven't found a way to reduce the space. But if you want to increase it put everything in your base row group into another group and set a custom inset on top and bottom

Anthony
  • 2,867
  • 1
  • 17
  • 17
1

You can remove the space by Clicking on the Controller that contains the group and set the Spacing property to default. Again, remember to do it in the Controller spacing property holding that particular group and not the group spacing property to 0. Hope this helps!

Brian
  • 14,610
  • 7
  • 35
  • 43
PS1690
  • 85
  • 8
0

According to the documentation, it seems WKInterfaceTable supports a single-column architecture and developers need to specify how many or what Row Type to use from storyboard or from code. For each code type, there is a root WKInterfaceGroup object. From the Attributes Inspector, there is a Size section which you can change the height of the group. Depending on your needs, you can play around with this attribute.

If you don't want to play around with the height attribute of the group, you can also play around with the Insets attribute. It's set as Default but you can set it to Custom and modify attributes such as Top, Bottom, and Spacing to fit your needs

https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/Tables.html#//apple_ref/doc/uid/TP40014969-CH14-SW1

j-techsha
  • 464
  • 4
  • 5
0

As of now, you cant remove the space but adjust the UI elements to include the space. Much better if you can use a black background.

Abhishek Bedi
  • 5,205
  • 2
  • 36
  • 62
0

Click on the group underneath your tableRowController, and then click on the : show attributes inspector. You can then change the Height of the Row Go under size and decrease the Adjustment amount .

here's a screenshot: Play around with the adjustment

AziCode
  • 2,510
  • 6
  • 27
  • 53
  • 1
    This works, though sadly only if you can set the row height to a fixed size and as a multiple of the screen. The adjustment will have to be different for 38 and 42 mm screens, I believe. – charles May 23 '15 at 20:02
0

To just remove the space between rows changing the background seems to be the best bet. If however you are trying to group the rows together and keep the rounded corners, the only way I have found to do this is by a "brute force" method. Lets say you know you will never have more than 10 items grouped together. You can make 10 table row templates, each with 1 more line displayed than the last (so you would have 1 table row displaying 1 line item, another table row displaying 2 line items, etc). This isn't really viable is you could have a lot of rows, but it is on a watch, so a user probably won't want to scroll through that many items anyways.

lehn0058
  • 19,977
  • 15
  • 69
  • 109
0

I don't think there is a way in which you can reduce the spacing between two cells presently, but you can alter the properties of the group that contains the table view, and you might get the desired results. For example, if you wish to have something like the picture below, where the two cells look adjoined, set the cell (Cell Group) color to be 'Clear Color', and set either a Background (Background Image) or Color (Background Color) for the group.

Screenshot with cells appearing adjoined

'quick-witted.' and 'Of, or pertaining to' are text on two different cells.

mvb
  • 701
  • 1
  • 11
  • 20