简体   繁体   English

iPhone Dev - 在UIScroll View上禁用缩放功能

[英]iPhone Dev - Disabling zoom feature on UIScroll View

Is there any way to make it so that the user can scroll along the UIScrollView but not be able to zoom into it? 是否有任何方法可以使用户可以沿UIScrollView滚动但无法放大它? I would appreciate any help i can get... Thank you. 我将不胜感激任何帮助......谢谢。

Note that you can answer questions like this yourself - for any object class. 请注意,您可以自己回答类似的问题 - 对于任何对象类。 Just command-click on the object in question (UIScrollView) and you would have seen: 只需按住命令单击相关对象(UIScrollView),您就会看到:

@property(nonatomic) float minimumZoomScale;     // default is 1.0
@property(nonatomic) float maximumZoomScale;     // default is 1.0. must be > minimum zoom scale to enable zooming

Set both the maximumZoomScale and minimumZoomScale properties of the scrollview to 1.0 . scrollview的maximumZoomScaleminimumZoomScale属性都设置为1.0

scrollview.maximumZoomScale = 1.0;
scrollview.minimumZoomScale = 1.0;

or do it in Interface Builder. 或者在Interface Builder中执行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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