PDA

View Full Version : UITextView insert




rubenmit
Aug 8, 2012, 09:30 AM
Hi all, I need to insert several UITextView but pressing a button insert.
The insertion should be when the program is running.
Thanks!



jnoxx
Aug 8, 2012, 10:41 AM
what... care to explain a bit more? not making any sence

rubenmit
Aug 8, 2012, 10:58 AM
what... care to explain a bit more? not making any sence

I would add a touch UITextView doing in a button, while the program is running

jnoxx
Aug 8, 2012, 11:31 AM
I still have no clue what you're talking about?
You want to add a UITextView when pressing a button...?

rubenmit
Aug 8, 2012, 11:36 AM
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
Aug 8, 2012, 12:53 PM
Connect a IBAction to a button then do..

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
Aug 8, 2012, 03:13 PM
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
Aug 8, 2012, 03:24 PM
Connect a IBAction to a button then do..

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
Aug 8, 2012, 03:38 PM
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?