问题描述
我有一个UIViewController包含一个UIScrollView,而UIScrollView包含一个UIImageView,并且我的手势识别器可以点按.当UIView在另一个视图中调用时,它将变为全屏显示,而当我双击UIView时,它会隐藏起来并再次显示主视图.捏一下没问题. UIPinchGestureRecognizer无法正常工作.我不认为它的响应者问题是因为窃听有效.我认为这与设置MultipleTouchEnabled值有关(但不确定).如果其结构类似于我的(UIViewController-> UIScrollView-> UIImageView),则需要将视图设置为启用了MultipleTouch.我的UIPinchGestureRecognizer目标是同时按下和轻按的UIViewController(自身).
I have an UIViewController contains an UIScrollView and UIScrollView contains an UIImageView, and I have my Gesture Recognizers tap and pinch. When UIView called inside another view it becomes fullscreen, and when my UIView double tapped it hides itself and main view appears again. No problem till pinching. UIPinchGestureRecognizer not working. I dont think its responder problem because, tapping works. I think its about setting MultipleTouchEnabled values (but not sure). if its with a structure like mine (UIViewController->UIScrollView->UIImageView) which views needs to be set as MultipleTouch enabled. My UIPinchGestureRecognizer target is UIViewController (self) for both pinch and tap.
如果有帮助,我可以张贴代码的必要部分.
if it will help I can post needed part of my code.
谢谢.
推荐答案
尝试设置
yourImageView.contentMode = UIViewContentModeScaleAspectFit;
这篇关于UIView UIPinchGestureRecognizer问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!