开发者

Capturing Touch Up Event in TextView

Is it possible?

Basically I want to show address of a restaurant. It could be in label or text view. However I need that label or text view to be multiline. Can I do so with label?

Also if user click on address they should be able to add the biz into their contact.

How would I do so because textView doesn't seem to 开发者_如何学Gocapture any action?


You can use a label. UILabel supports multilines through the property numberOfLines. Say your address is in an NSArray. You can do this –

// address is the array
// addressLabel is the label that needs to be updated.

addressLabel.numberOfLines = [address count];
addressLabel.text = [address componentsJoinedByString:@"\n"];

This should do it. Make sure you have allocated a proper frame for this. If there are a lot of lines, you can consider putting it in a UIScrollView.


you can use the uilabel's property called label.numberOfLines=someNumber;if you need any clarification ask me freely

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜