viewwilltransitiontosize

viewWillTransitionToSize and wrong navigationBar and statusBarFrame heights

感情迁移 提交于 2019-12-22 05:33:46
问题 I am trying to get the visible drawing area for a subclass of GLKViewController. In iOS 7, I would determine the orientation and then adjust [UIScreen mainScreen].bounds.size accordingly. Then I would subtract the navigationBar and statusBarFrame heights and voila! - the actual size of my drawing area. Now I'm trying to update for iOS 8 with viewWillTransitionToSize, however when I rotate the device (I have UIInterfaceOrientationMaskAll on), the size that is passed is wrong. In fact, the

Call viewWillTransition in didSelectItemAt indexpath

梦想的初衷 提交于 2019-12-11 05:09:30
问题 I have center of collectionview cell in viewWIllTransition function as follows var center = CGPoint() override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) coordinator.animate(alongsideTransition: { (context) -> Void in if (UIDevice.current.orientation == UIDeviceOrientation.portrait) { if let indexPath = self.categoryCV.indexPathsForSelectedItems?.first { print("Portrait") let

viewWillTransitionToSize causes non-rotating view controller to resize and reposition

对着背影说爱祢 提交于 2019-12-08 02:29:09
问题 A lot of people have discussed techniques for mimicking the native iOS camera app (where the UI elements pivot in-place as the device rotates). I actually asked a question about it before here. Most people have you lock the orientation of the UI, but then force a transformation on just the elements that you want to pivot. This works, but the elements don't pivot with the smooth animations you see in the native iOS app and it leads some issues. Specifically, part of my interface allows users

viewWillTransitionToSize causes non-rotating view controller to resize and reposition

青春壹個敷衍的年華 提交于 2019-12-06 11:40:31
A lot of people have discussed techniques for mimicking the native iOS camera app (where the UI elements pivot in-place as the device rotates). I actually asked a question about it before here . Most people have you lock the orientation of the UI, but then force a transformation on just the elements that you want to pivot. This works, but the elements don't pivot with the smooth animations you see in the native iOS app and it leads some issues. Specifically, part of my interface allows users to share without leaving this interface, but when the sharing view gets rotated, it comes out off

viewWillTransitionToSize and wrong navigationBar and statusBarFrame heights

谁都会走 提交于 2019-12-05 07:50:08
I am trying to get the visible drawing area for a subclass of GLKViewController. In iOS 7, I would determine the orientation and then adjust [UIScreen mainScreen].bounds.size accordingly. Then I would subtract the navigationBar and statusBarFrame heights and voila! - the actual size of my drawing area. Now I'm trying to update for iOS 8 with viewWillTransitionToSize, however when I rotate the device (I have UIInterfaceOrientationMaskAll on), the size that is passed is wrong. In fact, the width is correct for the view, but not the height (which involves the navbar and statusbar heights). I've

Nested UICollectionViews, AutoLayout and rotation in iOS 8

给你一囗甜甜゛ 提交于 2019-12-03 08:51:36
问题 I started to use AutoLayout for a large project and was positively surprised about it. However, now I have to adjust the project to accommodate for rotation and size classes, and I have big troubles getting the views to behave correctly. The base problem is that I have UICollectionViews with cells that again contain UICollectionViews . When the device is rotated, the base collection view adapts it's cells right, but all cells of the nested collection views are not adjusted to the new size

Nested UICollectionViews, AutoLayout and rotation in iOS 8

限于喜欢 提交于 2019-12-02 21:28:22
I started to use AutoLayout for a large project and was positively surprised about it. However, now I have to adjust the project to accommodate for rotation and size classes, and I have big troubles getting the views to behave correctly. The base problem is that I have UICollectionViews with cells that again contain UICollectionViews . When the device is rotated, the base collection view adapts it's cells right, but all cells of the nested collection views are not adjusted to the new size automatically. After investigation it comes down to: When viewWillTransitionToSize is called, the base

Swift viewWillTransition not called

倖福魔咒の 提交于 2019-11-28 14:00:46
I'm creating a full screen image gallery using a UICollectionView . When the user rotates the device, I perform updates to the UICollectionView within func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) I present this UIViewController modally and have a UICollectionView taking up the full screen. Within viewDidLoad , I create the flow layout as: let flowLayout = UICollectionViewFlowLayout() flowLayout.scrollDirection = .horizontal flowLayout.minimumInteritemSpacing = 0 flowLayout.minimumLineSpacing = 0 photosCollectionView.isPagingEnabled = true

Swift viewWillTransition not called

孤街醉人 提交于 2019-11-27 08:02:24
问题 I'm creating a full screen image gallery using a UICollectionView . When the user rotates the device, I perform updates to the UICollectionView within func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) I present this UIViewController modally and have a UICollectionView taking up the full screen. Within viewDidLoad , I create the flow layout as: let flowLayout = UICollectionViewFlowLayout() flowLayout.scrollDirection = .horizontal flowLayout