2009-09-17 10 views

Respuesta

22

Vas a tener que hacer esto mediante programación, no creo que esto es posible en el Interface Builder.

Eso sí, algo así como

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

en el método adecuado para ver (por ejemplo - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event) o el controlador de vista.

9
UITextView*txtview = 
    [[UITextView alloc]initWithFrame:CGRectMake(x,y,width,hight)]; 
[txtview setDelegate:self];  
[txtview setReturnKeyType:UIReturnKeyDone];  
[txtview setTag:1];  
[txtview setCornerRadius:5];  
[self.scrollview txtview]; 
1

En Swift

let textView = UITextView(frame: CGRectMake(x,y,width,height)) 
textView.textAlignment = NSTextAlignment.Center 
textView.textColor = UIColor.blueColor() 
textView.backgroundColor = UIColor.redColor() 
self.view.addSubview(textView) 
Cuestiones relacionadas