Questions tagged [viewdidlayoutsubviews]

48 questions
0
votes
1 answer

iOS get the subviews bounds when rotation happened

Once rotated the phone, how can I get subview's final bounds? As said, I rewrite the viewDidLayoutSubview method but only get the self.view's final bounds, the subview are using auto layout to positioning. So is there a way to get the subviews final…
Jin
  • 43
  • 5
0
votes
1 answer

moving app to background, calls viewDidLayoutSubView and create a lot of warnings with UICollectionView

it's all start from a lot of warnings about the width of collectionView cells, That was written to console every time I press home button. I thought it's something with size of the cells and tried to fix it. Only after some testing, I notice that…
user1105951
  • 2,117
  • 2
  • 28
  • 53
0
votes
0 answers

viewDidLayoutSubviews getting called twice and convertPoint improperly converting on first render

I am trying to animate UITabBar items by using a UIImageView and setting its frame in the same frame as my UITabBarItem's when the view first renders to the user. In a different project, it works fine on viewDidAppear, logs showing that the frame is…
0
votes
1 answer

Why doesn't code in (isMovingToParentViewController) run in viewDidLayoutSubviews()

I have a viewController, I'm using anchors and I want to get the frame of a button. I only want the frame when the view is pushed on so I use isMovingToParentViewController. Like this: if isMovingToParentViewController { let myButtonFrame =…
Lance Samaria
  • 11,429
  • 8
  • 67
  • 159
0
votes
2 answers

I want to change bottom layer of text field color when i start typing to blue

func designTextField() { //Set the horizontal line in bottom of text field nameLayer.frame = CGRect(x: 0, y: self.tfName.bounds.size.height-1, width: self.tfName.bounds.size.width, height: 1) nameLayer.backgroundColor =…
0
votes
1 answer

How do I efficiently manage screen size changes and redrawing with storyboards, initWithCoder, viewDidLoad and viewDidLayoutSubviews?

I am using storyboard layouts to set up view layout. I am supporting both iPhone and iPad layouts. When the view is created with initWithCoder:, it is initially created with the frame size of the device I was last looking at in Interface Builder. If…
0
votes
1 answer

UI Code in viewDidLayoutSubViews doesn't render correctly at runtime

I have recently been battling with my view controller to set the correct dimensions of a border on a UIView. *edit, this is for a static tableview (i am using it as a form). I am aware of rounding cells in a .xib and reusing the cell however I am…
0
votes
3 answers

getting highly confused by odd behaviour of viewController Method

I have overrided a method as override func viewDidLayoutSubviews() { // creating bottom line for textField let border = CALayer() let width = CGFloat(1.0) border.borderColor = UIColor.whiteColor().CGColor …
Umair Afzal
  • 4,398
  • 5
  • 22
  • 46
0
votes
1 answer

Override the Autolayout center values of UIButton in a Subview @ viewDidLayoutSubviews

I use Autolayout for a fairly complex Menu and really need it. All Buttons, UIViews etc. of my Menu are in a separate UIView called "menuSubview". If the user presses a button the whole "menuSubview" shifts to another position to reveal other parts…
0
votes
1 answer

PFLoginViewController infinite loop from viewDidLayoutSubviews?

Has anyone run into an issue in iOS 9 with PFLoginViewController (from the ParseUI framework)? In iOS 8, per the Parse documentation, I set up the custom fields to the LoginViewController in viewDidLayoutSubviews, however, in iOS 9, it enters into…
rswayz
  • 892
  • 2
  • 7
  • 20
0
votes
2 answers

iOS:TableView Not Scrolling Smoothly due to Setting Constraints at Runtime in CellForRowAtIndexPath

I am Using StoryBoard and Using Autolayout , I have set Constraints at runtime for Custom cell.Also I have set constraints in ViewDidLayoutSubviews to Handle Device Orientation. So This is taking time for Cell to configure and my cell is not…
0
votes
1 answer

When set new frame of tableview in viewDidLayoutSubviews app crashes in iOS 7

- (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; if (employeeListModel.count > 0) { if ([employeeListModel count]*90 < self.view.bounds.size.height-64) { CGRect frame = self.empListTableView.frame; …
Bhuvan Bhatt
  • 2,526
  • 16
  • 19
0
votes
0 answers

Call viewDidLayoutSubviews in iOS 7

I'm trying to implement a control called SCLAlerView which enhances Alert messages. But I'm facing a problem when iOS 7 is used (it wotks well on iOS 8). On portrait mode, alert view is shown correctly but in landscape mode or when rotates from…
RFG
  • 2,760
  • 2
  • 26
  • 43
0
votes
0 answers

Memory error with app termination in viewDidLayoutSubviews

I have setBackgroundImage in viewDidLayoutSubviews. It calls viewDidLayoutSubviews infinitely. As a result memory is increased with app termination. What am I doing wrong? It happens only in iPhone 5s and the same code works fine in iPad Air and…
0
votes
0 answers

Frame size is incorrect in viewdidload, viewdidappear

Using iOS8. Frame size of UIViewController's view is incorrect in viewDidLoad and viewDidAppear. I could get the correct frame size from viewDidLayoutSubviews and perform view updates (I need to invalidate a layout) but than handling rotation with…