UIScrollView Zooming - iphone

Hi
I have taken a uiscrollview in xib IBOUTLET and have added a subview uitextview, and in that textview, have done horizontal scrolling since there are some contents to be displayed . i just need to do one thing that when user zoom in textview it should zoom , like when user touches two finger , it should have zooming gesture and zoom the content i have tried a lot however it didn't work. please let me know

Put a UITextView object into a UIScrollView object, and make the uitextview larger than the scrollView.
Also set property
scrollView.contentSize = textView.frame.size;
should be placed in the scrollViewDidEndZooming delegate

Related

how to prohibit UIScrollview scrolling when move in specific area?

I put one UIImageview as subview in a UIScrollview. When I zoom in the image, I can scroll the image around. Can I disable the scrolling when I touch and moving in a rectangle area of the image?
I want to get information from touchesBegan() of customed UIScrollview and customed UIImageview, but I found that when there are scrolling, no touchesBegan is called in customed UIImageview.
yourScrollView.scrollEnabled = YES; for scroll to be enabled.
yourScrollView.scrollEnabled = NO; for scroll to be disabled.

UITableView Scroll w/ keyboardWillShow

I have uitableview scrolling upwards when keyboardWillShow event occurs. tableview is 320x148 and placed at the bottom of the uiview. When a user selects the first uitextfield, nsnotifcation is fired and moves the textfield accordingly.
My problem is, I have a label and logo in the background (uiview) that i want to see move upwards with the "event". I can do this with an animation, but it's not the desired effect.
My guess is to somehow make uiview move with uitableview somehow. Hope that makes sense.
Humm, i think you could put your UITableView inside a UIScrollView. When the UITableView scrolls, you could do the same to the UIScrollView behind..

Why a uitextfield inside a uiscroll view doesn't scroll?

I have a scrollview which contains a text field and a text view. I would that both two scrolled together. How can I do? Now only the text view scroll.
Precisely, I would that the title scrolls up while the user writes in the textview and, if the user decides to set it, he can scrolls up and refind the textfield.
Thanks
try this
in .h
IBOutlet UIScrollView *scrollView;
and connect it in the interface builder
and in your .m file put this into your viewDidLoad
[scrollView setScrollEnabled:YES];
[scrollView setFrame:CGRectMake(0,55,320,180)];
[scrollView setContentSize:CGSizeMake(320,320)];
then put your textField and your textView inside the scroolView in the interface builder
I want to say one thing,
Here the textfield can have only one line and the textview has multi-line of data.
So in your contest both will scroll, but you are saying one is scrolling and other is not.
In this what I am expecting is scrollview is not scrolling but the text view is showing its data(content).
Thats it.
If you want to check this, increase the textview frame upto its content and put userInteractionEnabled as NO and then set the scrollview content size to some what more than the textview size. Then you can observe both are scrolling.
Regards,
Satya

iPhone: UIScrollView not scrolling when adding item via IB

I'm trying to make a very simple scrolling page via IB. What I've got is a UIImageView at the top and 2 UIImageViews at the bottom, with a UITextView in the middle. I've disabled the scrolling in the UITextView as I won't the whole page to scroll up and down including the UIImageViews.
Can anyone tell me why the UIScrollView won't scroll up and down? All of the items above are subviews of UIScrollView via IB.
You can only scroll in a UIScrollView if the contentSize is larger than the frame. Have you set this?

UIScrollView scrolling not proper

I have a UIViewController subclass which has the view property set to a UIScrollView subclass (say ProfileScrollView). Now, I have overridden drawRect: method, in which I draw a lot of text and place UIButtons as subview in between texts. Depending on the text data, I set contentSize of the scrollView in this drawRect: method. Now, when I scroll this view the buttons are scrolling but the text remains stagnant. Please help with this problem. Thanks
I think your problem comes from the fact that you use drawRect: for your text. I'm pretty sure the positioning given by the CGRect argument is absolute and not depending on the scrollView's content's current offset.
Did you add your subviews (buttons and text) directly in the UIScrollView? If you did, try to insert a simple UIView in UIScrollView, which will contain all subviews. Should be something like this:
-> UIScrollView
-> UIView
-> UIButtons
-> Text
-> ...
So drawInRect: will draw the text in containing UIView with an absolute position, and UIScrollView will make UIView (and consequently all its contents) scroll.