skip to Main Content

Ios swift – AutoLayout layoutIfNeeded bounds update time

I have the following code in my custom UIView. This gets called from init(frame:) or init(coder:) initializer: private func setupContentView() { contentView = ContentView(frame: .zero) contentView.translatesAutoresizingMaskIntoConstraints = false addSubview(contentView) contentView.leftAnchor.constraint(equalTo: leftAnchor, constant:thumbWidth).isActive = true contentView.rightAnchor.constraint(equalTo: rightAnchor, constant: -thumbWidth).isActive = true…

VIEW QUESTION

Is iOS adjusting bottom constraint constant of view when keyboard visible larger on newer model iPhones?

I am setting up my keyboard will show notifier, getting the keyboard height, and setting the constant value on the bottom constraint as shown here: Notification Observer NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: UIResponder.keyboardWillShowNotification, object: nil) Keyboard Will Show Function @objc func…

VIEW QUESTION

UITableViewCell AutoLayout problem – Components appear outside the cell – Ios swift

The code below is where I set the constraints of the UITableViewCell. private func configureConstraints() { let agentIconImageViewConstraints = [ agentIconImageView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 10), agentIconImageView.topAnchor.constraint(equalTo: contentView.topAnchor,constant: 20), agentIconImageView.widthAnchor.constraint(equalToConstant: 64), agentIconImageView.heightAnchor.constraint(equalToConstant: 32) ] let flightTimeAndAirportsStackViewConstraints = [ flightTimeAndAirportsStackView.leadingAnchor.constraint(equalTo: agentIconImageView.trailingAnchor, constant: 10),…

VIEW QUESTION
Back To Top
Search