views:

718

answers:

1

For example: an UITextView will be created when a touch event happens.

How to do it?

Thanks

+3  A: 

You'll have to do this programmatically, I don't think this is possible in Interface Builder.

Just do something like

UITextView *myTextView = [[UITextView alloc] init];
myTextView.text = @"some text";
//some other setup like setting the font for the UITextView...
[self addSubview:myTextView];
[myTextView sizeToFit];

in the appropriate method of you view (e.g. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event) or your view controller.

mrueg