iOS UITextView insert

rubenmit

macrumors newbie
Original poster
Aug 8, 2012
4
0
Hi all, I need to insert several UITextView but pressing a button insert.
The insertion should be when the program is running.
Thanks!
 

rubenmit

macrumors newbie
Original poster
Aug 8, 2012
4
0
I still have no clue what you're talking about?
You want to add a UITextView when pressing a button...?
Yes, I want to add a UITextView (and other like IUView, IUImage...) when pressing a button, and
I want to resize, move, change color...
Like a power point, for now I just want to insert a UITextView.
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
Connect a IBAction to a button then do..
Code:
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0,0,100,100];
[textView setText:@"TEST TEXT"];
[self.view addSubview:textView];
I typed this out of my head, so check for code completion in the code.
 

Duncan C

macrumors 6502a
Jan 21, 2008
853
0
Northern Virginia
Hi all, I need to insert several UITextView but pressing a button insert.
The insertion should be when the program is running.
Thanks!
I gather that English is not your native language? You might want to get some help from a fluent English speaker, as your first couple of posts are just about unreadable.
 

rubenmit

macrumors newbie
Original poster
Aug 8, 2012
4
0
Connect a IBAction to a button then do..
Code:
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0,0,100,100];
[textView setText:@"TEST TEXT"];
[self.view addSubview:textView];
I typed this out of my head, so check for code completion in the code.
Yes but if I want to create multiple identical objects, How do I for set diferent names?
 

Duncan C

macrumors 6502a
Jan 21, 2008
853
0
Northern Virginia
Yes but if I want to create multiple identical objects, How do I for set diferent names?
You need to write code that creates multiple text fields at different locations, sets them to contain different text, and then adds them to your view controller's content view.

How you do that specifically will depend on what you want to do.

You could allocate a grid space on your app screen for these fields, and then write code that loops through the rows and columns, adding a text field at each location in the grid.

You asked "How do I for set diferent names?" What different names? How will you generate these different names? Looping?