I think have decent experience working with iPhone development.
as much I know.. I did set up the delegate..
I have from top to botton
UIView --> UIScrollView--> UITextView
I tried everything... to get the event scrollView to fire the scrollViewDidScroll event.
is anything wrong with the structure..
there not much of the code to post here.
what I am trying to do is.. do something when UITextView is scrolled.
Sorry did not respond... Just wanted to share in case anyone need this...
I used delegate methods of parent i.e. UIView for UIScrollView i.e. Child it worked..
It's hard to say without some code or a screenshot. Is the scroll view actually scrolling? If you set it up in Interface Builder, did you change the size of the scroll view's contentSize in code so that it can actually scroll? Maybe the text view is eating the scroll events; did you try setting the text view's delegate to see if it's firing a scrollViewDidScroll event?
Related
I have got a uitableview inside of a uiscrollview.
So the uitableview is smaller than the uiscrollview. And when I start to scroll down on the uitableview and it reaches the bottom, I am able to scroll in the uiscrollview.
And it works fairly. But not perfectly.
I would like to make the ux perfect so the scrollview would be kind of an extension (or another section of the uitableview). I don't want to add any section or footerview at the bottom of the tableview.
I was wondering on doing this by implementing something like this:
//
if tableview didscroll to bottom
then scrollview scrolltorect xxx
//
but it would only work if the uitableview was scrolling down.
I am not sure if this would replicate the correct ux behaviour.
Could you guys give me your advice on how to do this?
Thank you and best regards.
I found this very hard and difficult to execute so I changed my UI in order to put the bottom of the interface inside the tableview footer's view. This way the experience of scrolling my app got much smoother.
I have a strange issue , I have a page app in which one page I had used a UITextView, but when I tap on the UITextView it moves to the next page, can't write anything on it.
There is no issue when I use UIPageViewControllerTransitionStylePageCurl. The only issue is with UIPageViewControllerTransitionStyleScroll. Anyone know the solution? please help me
I ran into the same issue myself, and it appears that it's a consequence of some default behavior that occurs whenever a UITextField or UITextView becomes first responder inside a UIScrollView.
The solution to prevent your UITextView from scrolling the UIPageViewController is to first embed it into a UIScrollView instead of directly into a page's main view.
This works because when the UITextView becomes first responder it will search for the earliest superview in the view hierarchy that is of type UIScrollView, and it will scroll that scrollview to accommodate for the keyboard covering the screen. If you don't wrap the UITextView inside a UIScrollView, your UIPageViewController's internal UIScrollView will be chosen and scrolled, producing undesired behavior.
You can refer the link below..
UIPageViewControllerTransitionStylePageCurl - http://developer.apple.com/library/ios/#documentation/uikit/reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html
UIPageViewControllerTransitionStyleScroll - http://developer.apple.com/library/ios/#documentation/uikit/reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html
A UIScrollView in my view hierarchy is acting funky whenever I present a modal view controller above it. It automatically adjusts the content offset and moves my content down about 40 pixels. I can't seem to figure out how to stop this.
After snooping around I've found that the presentModalViewController somehow triggers the private method _adjustContentOffsetIfNecessary on my UIScrollView and this is what is changing the offset.
Any idea if this is a bug on Apple's part? Or is something getting set screwy in my UIScrollView? Anyway to disable this _adjustContentOffsetIfNecessary method or at least this side effect?
Although it is not fancy, I solved this resetting the content offset in the viewDidAppear of the presentingViewController.
Try setting the property automaticallyAdjustsScrollViewInsets of your ViewController, that contains the UIScrollView, to "NO"
I have 4 UIViews inside of a main view controller view. All I need to be able to do is drag the views around the "screen". Is UIScrollView the best option for this, or is there a simpler way?
Apple's Touches sample application contains code that does just this, so you might want to check it out.
UIScrollView should be used for scrolling, not dragging. And the 4 scroll views won't work if they're overlapped so don't even think of using UIScrollView in your case.
A dedicate UIView subclass that overrides -touches*****:withEvent: is needed. See http://github.com/erica/iphone-3.0-cookbook-/tree/master/C08-Gestures/01-Direct%20Manipulation/ for example.
I have a series of UIViews inside a UIScrollView, and the UIViewControllers for those views are not receiving the touch events. If I take the views out of the scroll view then it works.
I have enabled userInteraction on the views but it's still not working!
This must be possible and I'd be really grateful if someone could point me in the right direction!
Thanks,
Mike
Do the views have their own touch handlers, or are you relying on the viewcontroller to get the touches? Depending on how you have set things up, the views may be handling the touches without passing through to the view controller.
I have overcome this issue by overriding the loadView method of the view controller, and setting the view's instance variable to a simple UIView subclass which passes on the touches.
Check what you are returning in scrollview delegate method view for scrollin in scroll view.
As mahboudz mentioned - check if you have any custom handler for touch event. If not, please have one. Its far more relief to do whatever you want to do with your view. Check out Apples sample app from scrollViewSuite. They have tapDetectingImageView delegate. I used the same in my app it worked great! Hope this helps!
You may find this post useful. It's an example of a pretty clean way of intercepting events.
Have touch handlers for view for which you want to receive touch events and that will work.