简体   繁体   中英

iOS: how do I dynamically change a uiscrollview's minZoom every time its bounds are changed?

我想我可以继承它并重写minZoom的getter方法,但是有没有更简单的方法呢?

In your view controller override this -

- (void)viewWillLayoutSubviews

When a view's bounds change, the view adjusts the position of its subviews. Your view controller can override this method to make changes before the view lays out its subviews.

if this is too soon theres a viewDidLayoutSubviews

Change your scrolllviews zoom there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM