size-classes

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

三世轮回 提交于 2019-11-28 03:12:49
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 for spacing to nearest neighbor on top, bottom, left, and right Created a view that is a subView of the UIScrollView with the same width as the any width any height VC but height of 1500 (because I only want it to scroll vertically). Set constraints to nearest neighbor as 0 for ONLY left, top, and right and set the height constraint as 1500. I put a

iOS different constraints for different devices

感情迁移 提交于 2019-11-27 18:15:00
问题 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 = 105 回答1: we were facing similar issue. We solved with helper class called scaled. Which basically just multiply size of something, which should appear larger on larger device. extension CGFloat { public var scaled: CGFloat { switch UIDevice.type

iOS Different Font Sizes within Single Size Class for Different Devices

我与影子孤独终老i 提交于 2019-11-27 07:18:42
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 and 4 inch devices (iPhone 4 and 5), then relatively bigger for 4.7 inch (iPhone 6) and more bigger for 5.5 inch (iPhone 6 Plus) devices. I've searched but unable to find a solution to set different font size for different devices within same size class. Edit : I don't recommend this anymore. This approach doesn't scale well when new devices come out

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

浪尽此生 提交于 2019-11-27 04:38:48
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 systemLayoutSizeFittingSize on that to determine the correct row height - this method is explained wonderfully in this StackOverflow post and elsewhere . This worked great until I started using size classes. Specifically I've defined different constants on the margin constraints for text in Regular Width layouts, so there is more whitespace around the text on iPad.

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

爷,独闯天下 提交于 2019-11-27 02:46:52
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 size 12 on "any width, compact height" (such as on iPhones in landscape) configurations and size 18 on "regular width, regular height" configurations (such as on iPads). More information is available here: https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/Size-ClassSpecificLayout.html This is a really

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

删除回忆录丶 提交于 2019-11-26 23:58:39
问题 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 for spacing to nearest neighbor on top, bottom, left, and right Created a view that is a subView of the UIScrollView with the same width as the any width any height VC but height of 1500 (because I only want it to scroll vertically). Set constraints to

iOS Different Font Sizes within Single Size Class for Different Devices

旧城冷巷雨未停 提交于 2019-11-26 22:16:37
问题 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 and 4 inch devices (iPhone 4 and 5), then relatively bigger for 4.7 inch (iPhone 6) and more bigger for 5.5 inch (iPhone 6 Plus) devices. I've searched but unable to find a solution to set different font size for different devices within same size

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

南笙酒味 提交于 2019-11-26 12:36:14
问题 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 size 12 on \"any width, compact height\" (such as on iPhones in landscape) configurations and size 18 on \"regular width, regular height\" configurations (such as on iPads). More information is available here: https://developer.apple.com/library

Sizing class for iPad portrait and Landscape Modes

。_饼干妹妹 提交于 2019-11-26 01:55:49
问题 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 available for Iphones in portrait and landscape on the IB but however there seem to be none that cover individual landscape or portrait modes for the iPad on IB. Can anyone help? 回答1: It appears to be Apple's intent to treat both iPad orientations as