久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 iOS 5 模擬器上運行時,使用 iOS 6.0 SDK 并為 i

using iOS 6.0 SDK and building for iOS 5 Target causes UIScrollView setMinimumZoomScale to fail when running on iOS 5 simulator(在 iOS 5 模擬器上運行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構建會導致 UIScrollView setMinimumZ
本文介紹了在 iOS 5 模擬器上運行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構建會導致 UIScrollView setMinimumZoomScale 失敗的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

i upgraded to Xcode 4.5 and have started using the iOS SDK 6.0:

i have a universal app that had been developed with Xcode 4.4 and the iOS SDK 5.1

and it had been running on all devices and simulators tested without any glitches.

in hope of having it continue to work on the iPhone 5, i wanted to provide the proper launch-image and let it run.

many parts of the app work without changes, but one part of it does not: an image that i have placed in a UIScrollView does not pan. this has always worked previously, but not on the iOS 6 simulator.

to the real crux of the problem, though: when i went to run on the iOS 5.0 or iOS 5.1 simulators, in my debug log, i am seeing an exception thrown as follows:

-[NSKeyValueMethodSetter setMaximumNumberOfTouches:]: unrecognized selector sent to instance 0x6ddab20

the stack crawl shows that the code attempting to make this call is UIScrollView setMinimumZoomScale.

my code to call setMimimumZoomScale is as follows:

    CGFloat widthScale = self.scrollView.bounds.size.width / self.image.size.width;
    CGFloat heightScale = self.scrollView.bounds.size.height / self.image.size.height;

    // just reset the zoom scales; leave center and everything else where possible
    self.scrollView.minimumZoomScale = MIN(1.0, MIN(widthScale, heightScale));
    self.scrollView.maximumZoomScale = 4.0;

the thrown exception (and subsequent crash) occur on that first call to setMimimumZoomScale with the message noted above.

i am guessing that Xcode 4.5 is using code for setMinimumZoomScale that calls sends that message, which probably exists in the library for iOS 6, but never did in iOS 5.

are others seeing a similar problem?

fwiw, i have not touched my .storyboard files, so they would still be set to work without autoLayout.

do i have to go back and install Xcode 4.4 beside Xcode 4.5 in order to be able to continue to allow my working app to be maintained?

解決方案

answering my own question …

the complexity of my original question involved additional gesture recognizers.

under iOS 5.1 SDK (and some prior), it was possible to add a gesture recognizer to UIScrollView and be able to have it work in conjunction with panGestureRecognizer and pinchGestureRecognizer that are built into the UIScrollView.

under iOS 6.0 SDK, this behavior is apparently no longer really supported. the relevant documentation does not so much explicitly forbid the behavior as it does define what the UIScrollView will do for touches that may or may not be related to pan and pinch.

Because a scroll view has no scroll bars, it must know whether a touch signals an intent to scroll versus an intent to track a subview in the content. To make this determination, it temporarily intercepts a touch-down event by starting a timer and, before the timer fires, seeing if the touching finger makes any movement. If the timer fires without a significant change in position, the scroll view sends tracking events to the touched subview of the content view. If the user then drags their finger far enough before the timer elapses, the scroll view cancels any tracking in the subview and performs the scrolling itself. Subclasses can override the touchesShouldBegin:withEvent:inContentView:, pagingEnabled, and touchesShouldCancelInContentView: methods (which are called by the scroll view) to affect how the scroll view handles scrolling gestures.

in order to rectify the problem, i had to make sure that the gesture recognizers in the storyboard are no longer part of the collection associated with the scrollview, and instead associate them with the content-view of the scrollview.

(in my case, in order to do this, i had to manually add them using addGestureRecognizer: for each gesture-recognizer i am interested in, since the content-view is for images that aren't known at storyboard time.)

這篇關于在 iOS 5 模擬器上運行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構建會導致 UIScrollView setMinimumZoomScale 失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

how to set scrollview content size in swift 3.0(如何在 swift 3.0 中設置滾動視圖內容大小)
Stop a UITableView from automatically scrolling(阻止 UITableView 自動滾動)
iOS UIScrollView Lazy Loading(iOS UIScrollView 延遲加載)
Create partial-screen UIPageViewController programmatically(以編程方式創建部分屏幕 UIPageViewController)
UIImageView zoom and pinch in UIScrollView(UIImageView 在 UIScrollView 中縮放和捏合)
How can i add more than 10 buttons on a navigationbar in iphone application development?(如何在 iphone 應用程序開發中的導航欄上添加 10 多個按鈕?)
主站蜘蛛池模板: 亚洲成在线观看 | 四虎影院在线播放 | 久久久久久免费看 | 国产99视频精品免视看9 | 国产小视频在线 | 国产亚洲精品久久久久久牛牛 | 蜜桃臀av一区二区三区 | 免费黄色的视频 | 青青久草 | 欧美精品一区二区三区在线 | 成人中文字幕在线 | 亚洲最大看片网站 | 欧美色综合一区二区三区 | 精品久久久久久久久久久久久 | 亚洲视频一 | 久久久久九九九女人毛片 | 国产免费播放视频 | 欧美日韩中文字幕在线 | 岛国毛片| 久久高清 | 国产精品一区二区视频 | a级大片免费观看 | 欧美aaa级| 成人亚洲精品久久久久软件 | 亚洲成人自拍 | 午夜黄色 | 国产日产久久高清欧美一区 | 婷婷不卡 | 一级毛片视频在线观看 | 精品av | 久久久久久久久综合 | 一级黄色大片 | 一区二区小视频 | 久草热在线| 欧美久久久网站 | 亚洲精品永久免费 | 国产1区在线 | 亚洲人成人一区二区在线观看 | 一区二区三区在线电影 | 精品综合 | 欧美在线激情 |