开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜