Auto-scale up Enable, indicate problem

Be honest, I'm not a big fan of the car market. But, based on the job request, I have to accept the automatic layout, when I tried to make a simple zoom in the automatic layout, the position goes wrong.

this is what the storyboard image looks like

enter image description here

and this is what it looks like when auto-layout is disabled (I'm looking for the result)

enter image description here

and this is what it looks like when auto layout is on (wrong position)

enter image description here

and here are my limitations

enter image description here

And my code for zooming in:

self.batImageView.transform = CGAffineTransformMakeScale(3, 3);

I even need 10 rep to upload an image .. and 10 rep to post more than two links ....

Can someone help me post these images?

Thanks!!

+4
1

! Autolayout !:)

, - :

  • , .
  • 2 batImageView .
  • 2 , , .

batImageView :

batImageView constraints

IBOutlets :

@property IBOutlet NSLayoutConstraint *batImageViewWidthConstraint;
@property IBOutlet NSLayoutConstraint *batImageViewHeightConstraint;

, , , , :

CGFloat scaleFactor = 3.0;
self.batImageViewWidthConstraint.constant = scaleFactor * self.batImageViewWidthConstraint.constant;
self.batImageViewHeightConstraint.constant = scaleFactor * self.batImageViewHeightConstraint.constant;
[self setNeedsUpdateConstraints];
0

Source: https://habr.com/ru/post/1525990/


All Articles