Creating textViews on Button click
I have a UIButto开发者_Python百科n in UIViewController, i want add to dynamic number of UITextViews in the ViewController on this button click action. After creating textviews i am moving it using touches, but as i create a new textview the previous textview does not respond to touch event.Why is this happening? here is my code:
-(IBAction)createTextView{
UITextView *textView =[[UITextView alloc]init];
textView.frame=CGRectMake(40,40,10,300);
[self.view addSubview:textView];
}
Use textView.delegate=self;
after allocating the textView
. Hope it will work fine once its done.
精彩评论