I'm building an iOS application and I have a UITextView which I fill with a text. The text view is not big enough to store all the text so it just put "..." so that I can't see the rest of the text I've put in the view. Is there a way for me to make the UITextView to be multiline so that it can store all the text I've put in it?
Code :
instructionsTextField=[[UITextField alloc] initWithFrame:CGRectZero];
instructionsTextField.frame = CGRectMake(5, 5, self.view.bounds.size.width-10, 90);
instructionsTextField.backgroundColor = [UIColor whiteColor];
instructionsTextField.alpha = 0.5;
instructionsTextField.delegate = self;
instructionsTextField.text = string;
[mapView_ addSubview:instructionsTextField];
Solved My problem was that I've said that instructionsTextField is a UITextView but then I've allocated it as UITextField. Now it works fine.
You are using UITextField here, it cannot be made multilined(unless you add a view in it). please use UITextView instead.
Write it
instructionsTextField=[[UITextView alloc] initWithFrame:CGRectZero];
instructionsTextField.frame = CGRectMake(5, 5, self.view.bounds.size.width-10, 90);
instructionsTextField.backgroundColor = [UIColor whiteColor];
instructionsTextField.alpha = 0.5;
instructionsTextField.delegate = self;
instructionsTextField.text = string;
instructionsTextField.scrollEnable=YES;
instructionsTextField.userInteractionEnabled = YES;
instructionsTextField.editable=NO;
[mapView_ addSubview:instructionsTextField];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With