0

I'm using the newest releases from Xamarin (stable channel) and was preparing the app for republishing to the App Store. Since the last release, only a webservice url has changed. No changes in UI. However my table views look odd now. The only change that happened was the update of Xamarin Studio, Xamarin.iOS and Xamarin Mono. Executing the old App Store release doesn't have this visual issue (on the same device with iOS 9.2.3).

The two images show the difference at the left and right border. One has lot of spacing, while the other does not. And the row separator goes close to the left/right edge where the odd layout ends before. Funny thing is, that is not reproducible for every screen. Screens designed with the storyboard designer are okay. But table views which are implemented programatically aren't.

Is someone aware of any changes in this direction? I guess this issue has been driven by Xamarin or new default property in iOS SDK.

Old look (expected)

enter image description here enter image description here

New look (unexpected)

enter image description here enter image description here

JLT
  • 3,052
  • 9
  • 39
  • 86
dannyyy
  • 1,784
  • 2
  • 19
  • 43

1 Answers1

1

I had the same problem. The content of the table view had an inset on the left side. I Fixed this by using the code below.

YourTableView.ContentInset = new UIEdgeInsets(0, 0, 0, 0);

Let me know if this helps.

EDIT

There are a few other things you can try.

  1. Negative insets for left of the edge insets.
  2. Set the insets for your tableViewCell instead of your table.
  3. Set your layout margins to 0.
  4. Disable preserve superview margins
  5. Set the super view leading margin to 0.

Look at this post for using something like below. Which is number 4 above.

cell.preservesSuperviewLayoutMargins = true
cell.contentView.preservesSuperviewLayoutMargins = true
Community
  • 1
  • 1
Filled Stacks
  • 4,116
  • 1
  • 23
  • 36
  • Unfortunately nothing changed. Having a look in the debugger shows that the ContentInset is already set to (0, 0, 0, 0). – dannyyy May 18 '16 at 13:59
  • 1
    @dannyyy I edited my answer. Sorry for the late reply. Let me know if it helps. – Filled Stacks May 19 '16 at 12:01
  • Thank you for the hints. I tried every thing but the problem was not solvable. Changing these properties adjusted the content, but the cell width and the separators were still odd. Nevertheless I've created a view in my storyboard (as the others I have) and used the same controller and data source class and now it's like expected. If I have some time left I will examine the issue in more detail to find the cause. – dannyyy May 22 '16 at 08:14
  • @dannyyy I'm glad to hear that you have fixed it :) If you find out what it is can you please post the answer here if you get time. I would like to know what it was. Cheers – Filled Stacks May 23 '16 at 03:49