Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tutorials

Reply
 
LinkBack Thread Tools Display Modes
Old 03-03-2009, 02:36 PM   #1 (permalink)
Tutorial Author
 
Steaps's Avatar
 
Join Date: Oct 2008
Location: Ontario, Canada
Posts: 464
Steaps is on a distinguished road
Default [Tutorial] Moving An Object Into View

Ever had the keyboard cover up your UITextField, or other object that you must see when typing in your application? Well i suspect most of the beginners (Like me) have had this before and are not sure what to do. Well this is my take on how to get around this. Its pretty straight forward and easy to learn and do. Enjoy!

The tutorial is posted on my blog, located here:
Steaps’ Blog! :: iPhone SDK Help iPhone SDK Tutorials :: Tutorial: Scrolling An Object Into View

Please post comments on how the tutorial was etc. What could be improved.
Side Note: I believe the source code might have some things missing, but its not meant to be used, just set as an example. It works for what I'm trying to show how to do.
Steaps is offline   Reply With Quote
Old 04-27-2009, 04:16 PM   #2 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 110
Mike J is on a distinguished road
Default

Just curious....how would you do it if you had more than 1. When one was pressed none are moved and when the other is pressed it moves.
Mike J is offline   Reply With Quote
Old 05-10-2009, 10:04 PM   #3 (permalink)
Tutorial Author
 
Steaps's Avatar
 
Join Date: Oct 2008
Location: Ontario, Canada
Posts: 464
Steaps is on a distinguished road
Default

Not sure if that's spam or not?
Steaps is offline   Reply With Quote
Old 05-21-2009, 11:22 AM   #4 (permalink)
Registered Member
 
Join Date: Mar 2009
Location: Los Angeles, CA
Posts: 46
noodles is on a distinguished road
Default

Quote:
Originally Posted by Mike J View Post
Just curious....how would you do it if you had more than 1. When one was pressed none are moved and when the other is pressed it moves.
Hey. Here's a code snippet from one of my apps. I basically have 4 text fields and I keep them on their own view pane. When the didStartEditing is called it slides the whole view pane the propper distance so each text field gets put in the same place for editing. If you do not want to make a separate view pane for your text fields, you could just slide whichever view is their superview.

Code:
- (IBAction)didStartEditing:(UITextField *)textField { 	//move the text fields into view
	[UIView beginAnimations: @"center text" context: nil];
	[UIView setAnimationDelegate: self];
	[UIView setAnimationDuration:0.35];
	[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
	float newY =  textContainer.frame.origin.y - (textField.frame.origin.y - 75);
	[textContainer setFrame:CGRectMake(textContainer.frame.origin.x, newY, 349, 231)];	
	[UIView commitAnimations];
}
textContainer is just a UIView holding 4 UITextField's.

-noodles
noodles is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 471
18 members and 453 guests
7twenty7, alexeir, David-T, Dj_kades, Elad, foslock, HemiMG, iAppDeveloper, jeroenkeij, LunarMoon, Mijator, Pauluz85, pipposanta, QuantumDoja, robsmy, sacha1996, smithdale87, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,679
Threads: 94,129
Posts: 402,928
Top Poster: BrianSlick (7,990)
Welcome to our newest member, xzoonxoom
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:21 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0