size-classes

Any-Any size class ignored for ios7

混江龙づ霸主 提交于 2019-12-21 10:48:38
问题 I'm developing for both iOS7 and 8 iPhone. Since iOS7 doesn't support compact-height size classes, I thought the consensus way to go about this was to use the any-any size class for landscape iPhone layouts, and use portrait compact-width regular-height (cWrH) size class for portrait iPhone layouts. I set a constraint on a view in any-any, then modify a constraint constant in cWrH to be specific to that size class. However, iOS7 device as well as Xcode preview ignores the any-any constraint,

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

孤街浪徒 提交于 2019-12-17 07:31:59
问题 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

Understanding IOS8 size classes

假装没事ソ 提交于 2019-12-13 20:24:27
问题 I have been playing around on Xcode with size classes to try and make sense of it. The problem I have is that many different sized phones all fit into the same size class (like all iPhones in portrait) so I can't home in on a 3.5 inch screen for example. This is frustrating as I would like to change the layout constraints between phones rather than just classes as obviously I need to make the gaps between things larger or the buttons slightly bigger to keep everything in proportion. I don't

Incorrect frame being reported using Autolayout & Size Classes

馋奶兔 提交于 2019-12-13 05:42:35
问题 I've laid out a UIView in my UIViewController. Constrained its height and width, and centered it vertically and horizontally with constraints, but when I log its frame, it reports a location that seems appropriate to the full sizeClass, but not the size of the screen I'm looking at. For example the default size class UIViewController has a width of 600px, and in that size, my UIView is 150px from the left edge. When I check this distance from the left edge while running in the iphone5

Why is my Toolbar getting chopped off in compact size?

强颜欢笑 提交于 2019-12-13 05:39:09
问题 As can be seen below, my toolbar gets chopped off in the compact size: My UI consists of a ToolBar and a WebView. The constraints I tried don't work, although I did get them to turn blue. As you can see, my toolbar is pinned to the top, the left side, and the right side (I also set a constant height). How can I get my toolbar to display correctly in the compact size. Thanks. Edit1: Edit2: Here is what I did to get things to display correctly: I had to drag the edges of the WebView all the way

Adaptive swapping of View Controllers in response to Size Class Trait changes iOS 9

社会主义新天地 提交于 2019-12-12 09:20:13
问题 (I have read other answers on this subject, but they refer to older tech and practices.) I have also read: https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/TheAdaptiveModel.html I have an iOS app featuring 3 pages (1 per tab). The storyboard architecture is as follows: TabBarController -> Navigation Controller 1 -> View Controller 1 -> Navigation Controller 2 -> View Controller 2 -> Navigation Controller 3 -> View Controller 3 The app features major UI

UITraitCollection Class for Updating the Size Class

此生再无相见时 提交于 2019-12-12 05:36:59
问题 Shall i use UITraitCollection Class for Updating the Size Class constraints? Is this Best Practice to update the Constraints? I have gone through the UITraitCollection, but don't know how to differentiate portrait and Landscape? 回答1: It sounds like you want a different layout based on iPad orientation. If adjusting constraint values is all you need to do, you can check the UITraitCollection 's horizontalSizeClass and verticalSizeClass properties. The size class properties values can be found

traitCollection.horizontalSizeClass reports Compact on iOS 8.1, Regular on iOS 8.4 and 9.x

為{幸葍}努か 提交于 2019-12-12 04:31:55
问题 I am adding a Done button in the code to the Navigation Bar for a UIViewController subclass for iPad only, more precisely for Regular Size Class with the below code. We support iOS 8+. The if statement returns Compact Size Class when run on iPad Air 2 with iOS 8.1, and it correctly reports Regular for iOS 8.4 or iOS 9. Is this a bug in iOS, or am I doing something wrong? /// Add 'Done' button for iPad/Regular Size Class private func addDoneButtonIfNeeded() { if traitCollection

Universal storyboard UITableview row Height

左心房为你撑大大i 提交于 2019-12-12 03:26:34
问题 Using Storyboard sizeClasses i want to define the different TableView Row Height Using UITableView Row Height Automatic based on screen height (Specially in iPad) Using Static TableView i Also want to achieve the Dynamic Row so that we can utilize the screen Height It might be possible that the Question is very old and may be its duplicate also but i have searched and not getting proper result so its better i should ask this again might be something new in Xcode 7 with iOS 9 so guys anyone

Auto layout + size classes issue in swift

纵然是瞬间 提交于 2019-12-11 04:49:52
问题 In the above view, viewB is a subview of viewA created using an xib and the constrains also added in the xib. viewB has constrains top, bottom, leading & trailing relative to its superview. The file owner is swift view controller. viewB is connected with the file owner @IBOutlet weak var viewB: UIView! But when I run the project in iPAD running iOS 8 the viewB is not visible? (in the iPhone it is visible) I tried to access its frame in viewdidLoad & viewDidAppear, it is (0.0,0.0,0.0,0.0) This