1

I am using size classes in a xib for UITableViewHeaderFooterView. I have installed: a default constant, one for compact width any height, and one for regular width any height. The content shows up correctly in Xcode IB previews, but the regular width size class doesn't seem to be applied at all in the iPad simulator or actual iPad.

Size classes were off in the storyboard that contains the main UITableViewController, but turning them on didn't help.

Thoughts?

p.s. It might even help to know how to tell what size class is actually being used at runtime in debug mode... anyone know how to do that?

lemon lime pomelo
  • 316
  • 1
  • 2
  • 14
  • Ok, I tried `po [self traitCollection]` at runtime in the debugger and found that `_UITraitNameHorizontalSizeClass = Compact`, so it seems that this view is getting called compact, though I'm not sure if that's because it is narrower than the full width of the iPad screen or not... it is wider than iPhone 6+, fwiw – lemon lime pomelo Apr 23 '15 at 19:52
  • Ok, another update. I see that the view controller for the full screen has `_UITraitNameHorizontalSizeClass = Regular`, but that the views for the pop-up view have `_UITraitNameHorizontalSizeClass = Compact`. I am now searching to see at what width iOS decides to call it `Compact`. (My view in question is still wider than an iPhone 6+ width, and supposedly an iPad mini has Regular width...) – lemon lime pomelo Apr 23 '15 at 20:42
  • Can you post a screenshot of your constraints? It would be nice to see which constraints are installed in which size classes. See [this answer](http://stackoverflow.com/questions/29730765/autolayout-size-classes-different-proportional-heights/29731639#29731639) for an example of what I'm interested in. – József Vesza Apr 27 '15 at 11:58

1 Answers1

0

iPad treats both landscape and portrait as regular / regular. It's hard to understand the design concept, but below answer shows a trick how to handle.

Sizing class for iPad portrait and Landscape Modes

Community
  • 1
  • 1
hebinda
  • 519
  • 6
  • 14