vicky vicky - 1 year ago 109
iOS Question

How To Fix UITextView in storyboard TextView

Here i want to fix a UITextView which i created programatically in textView added on storyboard. I have tried it this way but not working.

_textView is a textView in which i have to fix UITextView *descrip

contentView is the view on which i have _textView.

UITextView *descrip = [[UITextView alloc]init];

descrip.view.frame = CGRectMake(_textView.frame.origin.x,_textView.frame.origin.y,_textView.frame.size.width,_textView.frame.size.height);

[self.contentView addSubview:descrip.view];

Answer Source

here is proper method

UITextView *descrip = [[UITextView alloc]initWithframe:CGRectMake(_textView.frame.origin.x,_textView.frame.origin.y,_textView.frame.size.width,_textView.frame.size.height)]
  [self.contentView addSubview:descrip];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download