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

在 iOS 5 模擬器上運(yùn)行時,使用 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 模擬器上運(yùn)行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構(gòu)建會導(dǎo)致 UIScrollView setMinimumZ
本文介紹了在 iOS 5 模擬器上運(yùn)行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構(gòu)建會導(dǎo)致 UIScrollView setMinimumZoomScale 失敗的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

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.)

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

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

相關(guān)文檔推薦

how to set scrollview content size in swift 3.0(如何在 swift 3.0 中設(shè)置滾動視圖內(nèi)容大小)
Stop a UITableView from automatically scrolling(阻止 UITableView 自動滾動)
iOS UIScrollView Lazy Loading(iOS UIScrollView 延遲加載)
Create partial-screen UIPageViewController programmatically(以編程方式創(chuàng)建部分屏幕 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 應(yīng)用程序開發(fā)中的導(dǎo)航欄上添加 10 多個按鈕?)
主站蜘蛛池模板: 国产精品免费观看 | 男女啪啪高潮无遮挡免费动态 | 亚洲一区二区三 | 亚洲日本一区二区 | 麻豆国产精品777777在线 | 亚洲欧美一区二区三区在线 | 精品日韩一区二区 | 亚洲国产欧美国产综合一区 | 亚洲精品自在在线观看 | 国产综合一区二区 | 中文字幕国产一区 | 欧美一区二区在线观看 | 成人午夜免费视频 | 亚洲精品视频免费看 | 日韩免费高清视频 | 在线国产视频 | 欧美成人精品在线 | 99久久精品视频免费 | 蜜桃视频在线观看免费视频网站www | 免费日韩网站 | 欧美日韩国产在线观看 | av在线视 | 成人免费小视频 | 亚洲欧美在线一区 | 中文字幕日韩一区 | 国产99久久久久 | 亚洲电影一级片 | 99久久精品免费看国产四区 | 日本三级电影在线看 | 色眯眯视频在线观看 | 日韩最新网站 | 亚洲精品成人av久久 | 久久精品国产亚洲 | 亚洲成av片人久久久 | 97色在线视频 | 国产一区二区精华 | 国产精品jizz在线观看老狼 | 亚洲精品久久区二区三区蜜桃臀 | 三区在线 | 欧美午夜一区 | 99热都是精品 |