I am working on an application which has the same user interface as iPhone SMS Application. I want to make a "To" text field to add multiple contacts from the address book.
How can I make the blue bubble in text after selecting the con开发者_如何转开发tact from the address book? Also, I want to make the message text field auto resize - when the given frame ends, it will start scrolling down.
You'll most likely want to use a UIWebView, or a completely custom UIView, rather than a UITextView. Those bubbles are all custom drawn, there's no API for using them. You'll have to place each chunk of text, and then draw the bubble around it.
For the message you need UITextView
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
textField.frame = CGRectMake(textField.frame.origin.x, textField.frame.origin.y-(textField.contentSize.height-textField.frame.size.height), textField.frame.size.width, textField.contentSize.height)
return YES;
}
精彩评论