Questions tagged [size-classes]

Size-class is an iOS system to allow for customizing layout, for different devices (phone versus pad, small versus large), while maintaining only the one storyboard. Each device/orientation has a "trait collection" used by autolayout.

514 questions
104
votes
14 answers

Custom Font Sizing in Xcode 6 Size Classes not working properly with Custom Fonts

Xcode 6 has a new feature where fonts and font sizes in UILabel, UITextField, and UIButton can be set automatically based on the size class of the current device configuration, right in the storyboard. For example, you can set a UILabel to use font…
mnemia
  • 1,529
  • 2
  • 12
  • 14
98
votes
7 answers

Sizing class for iPad portrait and Landscape Modes

I basically want to have my subviews positioned differently depending upon the orientation of the iPad (Portrait or Landscape) using Sizing Classes introduced in xcode 6. I have found numerous tutorials explaining how different sizing classes are…
neelIVP
  • 981
  • 1
  • 7
  • 4
45
votes
4 answers

Programmatically implementing two different layouts using size classes

I have a four buttons layout. In portrait they should be shown one above the other. In landscape they should be in two columns each with two buttons. I implement the buttons in code - really simple stuff: UIButton *btn1 = [[UIButton alloc]…
Joseph
  • 8,638
  • 7
  • 36
  • 63
39
votes
2 answers

iOS 8 size classes for iPad landscape

It seems all the current iOS devices maps to the new iOS 8 size classes nicely except iPad landscape? I seem not able to figure out how to use the size class feature to draw a different scene for iPad landscape (different from iPad portrait)? Is…
Sean
  • 1,923
  • 2
  • 22
  • 30
36
votes
5 answers

iOS- Detect current size classes on viewDidLoad

I'm working with adaptive Layout on iOS 8 and I want to get exactly what the size classes are on viewDidLoad. Any ideas about that?
user3193307
  • 413
  • 1
  • 4
  • 8
28
votes
1 answer

Why compact width and compact height in iPhone 4,5,6 in landscape orientation

I am new in iOS development and just studying Adaptivity and Layout I am stuck with a little confusion, As per the Documentation iOS defines two size classes: Regular :- It is associated with expansive space Compact :- It is associated with…
Shree Krishna
  • 7,883
  • 6
  • 34
  • 66
27
votes
0 answers

How to Update Frames for all Size Classes in a Storyboard in Xcode 6.1?

When working with Storyboard files in Interface Builder on Xcode 6.1, Apple recommends designing for the Any/Any size class. When finished, different size classes sometimes report warnings: Misplaced View - Frame for "Some Button" will be different…
Dave Gallagher
  • 353
  • 3
  • 6
26
votes
4 answers

iPad Landscape and Portrait different layouts with Size Class

How to design iPad Landscape and Portrait screens with different Layouts using Size class. I could find only w-regular and h-regular for both orientations. Example: I need to align 2 views vertically in portrait and horizontally in landscape using…
22
votes
5 answers

Size class specifically for portrait 3.5 inch (iPhone 4S) Xcode 6?

I'm tuning my UI App, but I got an issue that I can't solve. As I can see Compact height affects all iPhones under 4.7 inches, but my UI is fine except for the iPhone 4S (3.5 inches). I don't want to modify the layout for all iPhones under 4.7…
Helen Wood
  • 1,814
  • 2
  • 23
  • 39
22
votes
4 answers

UIScrollView in Storyboard not working with iOS 8 Size Classes and Autolayout

So I'm trying to create a UIScrollView only in storyboard that allows me to add scrolling labels for more than the height of the VC. Here's what I did: Created UIScrollView that took up the size of the any width any height VC Made constraints 0…
Lucas
  • 703
  • 2
  • 8
  • 17
17
votes
1 answer

Using Size Classes in IBInspectable properties

Is there a way we can make our IBInspectable properties feature Size Classes in Interface Builder? (Similar to Font) Clicking the '+' sign would allow you to choose a different font (size and other properties) for a different size class. I'm asking…
chrisamanse
  • 3,933
  • 1
  • 21
  • 32
17
votes
7 answers

iOS Different Font Sizes within Single Size Class for Different Devices

In iOS 8, we can design a different UI layout for each size class. The issue I'm facing is, I've designed a layout for Compact Width and Regular Height (size class for all iPhones in portrait) but i want to keep font size of labels smaller for 3.5…
Maverick
  • 2,795
  • 1
  • 30
  • 36
15
votes
2 answers

Offscreen UITableViewCells (for size calculations) not respecting size class?

I am using Auto Layout and size classes inside a UITableView with cells that self-size based on their content. For this I'm using the method where for each type of cell, you keep an offscreen instance of that cell around and use…
KennyDeriemaeker
  • 2,141
  • 1
  • 15
  • 15
15
votes
1 answer

Use Size Classes in Xcode 6 beta

Built a new project from scratch in Swift in Xcode 6 (Beta 1) and see File Inspector of Storyboard. There is Use Size Classes below Use Auto Layout. This is the screenshot of this. 1) What is Use Size Classes? 2) Is it related with iPhone 6 screen…
Yogesh Suthar
  • 29,554
  • 17
  • 66
  • 96
14
votes
4 answers

iOS different constraints for different devices

I have a ViewController designed for iPhone SE As you can see I also have a constraint Align Top to: Safe Area Equals 75 The question is, is it possible to change this value for iPhone 8 and iPhone 8 Plus? For example: SE = 75 8 = 85 8 Plus =…
xskit
  • 381
  • 7
  • 18
1
2 3
34 35