uiscrollview

UIScrollView scrolling only with one finger

99封情书 提交于 2019-12-19 11:13:50
问题 iOS7 & iOS8 I need to disable 2 or three fingers scrolling in UIScrollview . I tried : [self.scrollView.panGestureRecognizer setMaximumNumberOfTouches:1]; [self.scrollView.panGestureRecognizer setMinimumNumberOfTouches:1]; But it has no effect. It is still possible to scroll with 2 fingers. If i tried to set max and min to 2. One finger scrolling was disabled but 3 fingers scrolling possible :( I tried this too, but without success: for (UIGestureRecognizer* pan in self.scrollView

UIScrollView blocks run loop?

牧云@^-^@ 提交于 2019-12-19 10:30:32
问题 I implemented a NSTimer(repeats) and UITableView on the same viewController. Somehow, when I scroll through the tableView, the run loop seems to stop firing the NSTimer. The same goes for UITextView, which is also a subclass of UIScrollView. May I know what is happening here? 回答1: The reason that the timer stops firing is that the run loop switches to UITrackingRunLoopMode during scrolling and the timer is not added by default to that mode. You can do that manually when you start the timer:

How can a superview interecept a touch sequence before any of its subviews?

六月ゝ 毕业季﹏ 提交于 2019-12-19 10:18:19
问题 I have a view hierarchy that is layed out as follows: parentView scrollView contentViewA containerView contentViewB contentViewC I want contentViewB to respond to touches. Unfortunately scrollView makes this almost impossible because it tries to ingest the touches itself making touch response of contentViewB spotty. So, instead, I want to intercept all touches in the parentView, manipulate contentViewB directly, and then pass the touches on to scrollView so it can do its thing. Can someone

laying out images in UIScrollView automatically

喜你入骨 提交于 2019-12-19 10:18:07
问题 i have a list of images retrieved from xml i want to populate them to a uiscrollview in an order such that it will look like this. 1 2 3 4 5 6 7 8 9 10 if there is only 10 images it will just stop here. right now my current code is this for (int i = 3; i<[appDelegate.ZensaiALLitems count]-1; i++) { UIButton *zenbutton2 =[UIButton buttonWithType:UIButtonTypeCustom]; Items *ZensaiPLUitems = [appDelegate.ZensaiALLitems objectAtIndex:i]; NSURL *ZensaiimageSmallURL = [NSURL URLWithString

UITextView text cut off when there is a large amount of text

十年热恋 提交于 2019-12-19 08:54:11
问题 I have a UITableViewCell subclass that contains a UITextView where scrolling is turned off. I set its frame like this, in my table view cell layoutSubviews method: CGRect frame = self.bodyTextView.frame; CGSize size = self.bodyTextView.contentSize; frame.size = size; self.bodyTextView.frame = frame; This has been working fine for some time, but I've noticed that in a case where I have a particularly large amount of text, the text is getting cut off. I've set the text view frame background

Changing between colors based on UIScrollView's contentOffset

心已入冬 提交于 2019-12-19 08:29:21
问题 I have a horizontal UIScrollView that has a width of 960 , enough to hold 3 UIViewController view's. Each view simply has a background color. The first is pink, the second is blue, and the third is green. I want to blend/mix/fade the visible colors together as the user scrolls. So if you were scrolling from page 1 (pink) to page 2 (blue), there would be some type of mix/blend/fade of pink and blue before finally landing on the final blue color when the user fully swiped to the 2nd page. I

ScrollView created in storyboard initialized with frame 0,0,0,0

筅森魡賤 提交于 2019-12-19 06:56:26
问题 I created a UIScrollView in the storyboard, linked it as a property to the view controller, and am now trying to add some subviews with pagination. But, even though I set the dimensions in the storyboard graphically, the frame of the UIScrollView ends up being 0,0,0,0. Am I required to hardcode the dimensions even though I already specified them graphically in the storyboard? Also, kind of related, is it possible to customize subviews in the storyboard to use in this scroll view? It seems

How to use scroll view on iPhone?

别说谁变了你拦得住时间么 提交于 2019-12-19 05:49:29
问题 I want to display a text with a lot of lines. I added a multiline-label to a scroll view, but it didn't show anything. Looks like this is not the correct way to use the scroll view. How to use scroll view so that users can drag down to see more text? 回答1: You can just use a UITextView. It's a child of UIScrollView, and if you set it's text property to an amount of text that does not fit within it's frame, the view will become scrollable. 回答2: Apple's UIScollView documentation is quite good,

Setting a UITableView's contentInset through Storyboard in Xcode 6

半城伤御伤魂 提交于 2019-12-19 05:13:09
问题 On Xcode 6, it seems that the ability to set the content inset of a scroll view/table view through UIStoryboard has been taken away. See image below: the parameters on the left are from Xcode 6, whereas the parameters on the right are from Xcode 5 Does anyone know if the parameters have moved, or are we no longer able to set the content inset through UIStoryboard? I'd really like to keep this out of my code if possible.. 回答1: You can do that by using KVC Select table view Choose Identity

Get the height of the UIScrollView after layout in Swift

旧时模样 提交于 2019-12-19 05:06:29
问题 I have a situation where I'm using a UIScrollView to help users with smaller phones see the full text inside a window. And I was wanting to show an image icon if they needed to scroll (just so that they know there is more inside the window) but I'm having a problem finding the height of the scrollview using Swift. This is the hierarchy of my objects Basically, those 4 labels fit inside a 4.7" iPhone but not the 4" iPhone. I tried setting some logic to check if the UIScrollView content is