I am using auto layout,
I want to make a smaller UISwitch and then use view.transform = CGAffineTransformMakeScale(0.5, 0.5)
to realize it.
There is another view above this switch. This switch's leading should be aligned to this view's leading edge, and there is a fixed vertical space between view and switch, like following picture:
Views on iOS7
However, there is different appearance on iOS8:
Views on iOS8
Seems like constraints are not applied to this switch.
But I called self.view.layoutSubviews()
and
self.view.layoutIfNeeded()
It doesn't work.
How to let this switch is always sticked to the right bottom corner of the above view?
Here is switch not scaled down