Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 22, 2011, 02:46 AM   #1
CheshireFool
macrumors newbie
 
Join Date: Jan 2011
Creating a button that adds more text fields?

I'm trying to wrap my head around how to have the application elements that will automatically add text fields and round rectangle buttons to a scroll view and increase the ContentSize of the scroll view as needed to allow for more rows of text fields & round rectangle buttons.

At this point even better google search hints are appreciated.
CheshireFool is offline   0 Reply With Quote
Old Jan 22, 2011, 02:55 PM   #2
dejo
Moderator
 
dejo's Avatar
 
Join Date: Sep 2004
Location: The Centennial State
Divide and conquer. Break the problem down into smaller, solvable problems. Also, what specific help are you looking for?
__________________
dejo is offline   0 Reply With Quote
Old Jan 24, 2011, 01:39 AM   #3
CheshireFool
Thread Starter
macrumors newbie
 
Join Date: Jan 2011
Well to break it down:

1. create a 'round rectangle button' that when pushed, will create a 'text field'.

2. when the button is pressed, the new 'text field' needs to orient with the button, and the button needs to move down out of the way so that the two objects do not overlap

3. the effective dimensions of the scroll view need to expand every time the button is pressed to make room for more text fields.
CheshireFool is offline   0 Reply With Quote
Old Jan 24, 2011, 11:53 AM   #4
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by CheshireFool View Post
Well to break it down:

1. create a 'round rectangle button' that when pushed, will create a 'text field'.

2. when the button is pressed, the new 'text field' needs to orient with the button, and the button needs to move down out of the way so that the two objects do not overlap

3. the effective dimensions of the scroll view need to expand every time the button is pressed to make room for more text fields.
Take the analysis further, and what do you have?

After pressing the button 15 times, you'll have a table of 15 text fields arranged in a single column, with a button below them.

What would you normally use to display a table? UITableView.

So read about that class, and its data source, delegate, and cell relationships. It scrolls. It automatically expands when you insert a cell. It moves cells up or down depending on where you insert the cell. Other than the button below, a UITableView of text fields would be exactly what you want.

So now think about different ways you can make the item below the last text-field a button. Can you place a sub-view there containing the button? Can you make the last table-cell a different cell-type that contains a button? Read the reference docs.
chown33 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Stock App - radio button link to text field marcmeezy Mac Programming 5 Feb 22, 2011 05:14 AM
How To Add Buttons Inside Text Field? Blakeasd Mac Programming 6 Oct 27, 2010 12:27 PM
How to remove cursor from text field on click of button? Monaj Mac Programming 2 May 31, 2010 11:45 AM
Xcode example project text field and a save button XMLove Mac Programming 0 Jun 21, 2009 04:29 PM
Creating a Button that plays a sound file. sweeneytodd iPhone/iPad Programming 3 Jul 13, 2008 09:17 PM


All times are GMT -5. The time now is 04:54 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC