ios - UIButton not respect Aspect Fill contentMode after resizing animation -


I am using the automatic layout, the initial state of the following scene

a view in the center Has a button. Fill the content mode aspect in the button, and the image is set as the background image of the button.

Enter image details here

Then I change the view for'd use the following code, which will expand the center card to fill the screen, and the picture will be taken over the scene:

  cardTrailingSpaceConstraint.constant = 0 cardLeadingSpaceConstraint. constant = 0 cardView.removeConstraint (Kardspectoraitio Kantreshn) card to Haiit consultant = Anselut contract (item: Kardwu, attribute: Kiti T, Related to: Av. Aval, Photo: View, Attribute: Heat, Multiplier: 1.0, Continuous: 0). Address Control (card-high-control) dishimagebutton.removeConstraint (dishButtonBottomSpaceConstraint) Dishboot dethantight CONNECTENT = NSLUT CONTRACTATION (item: DISH ImageButtons, attribute: .ightit, related: AQUAL, TOITAM: cardview, attribute: .IT, multiplier: 0.2, continuous: 0 ) Kardvijh.adsinstrenth (Disbutnhait Kantreshn)) CardView.setNeedsUpdateConstraints () UIView.animateWithDuration (0.7, delay: SpringWithDamping using 0,: 0.7, initialSpringVelocity: 0.7, options: zero, Animations: {[unowned self] () - & Gt; self Ard. Header = 0 self.cardView.layer.cornerRadius = 0 self.cardView.layoutIfNeeded ()}) {[Unknown themselves] (end) - & gt; Zero}}   

is the result:

enter Image description here

However, this is not my wish. The button is not respecting the content.

Can anyone tell me how to fill the aspect of the aspect of the Maintenance button?

  1. type the button UIButtonTypeCustom (รข ???
  2. button image, set the background image of the button.
  3. the viewDidLoad , set button.imageView.contentMode < / Code> to UIViewContentMode.ScaleAspectFill .

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -