开发者

Add UIButton to UITextView Dynamically with UserInteractionEnabled

I am building an app where I need to add buttons to a UITextView dynamically on the basis of text entere开发者_如何学Cd by the user in the same UITextView.

The look I want to give is something like To field in message app of iPhone

I am unsable to figure out the way to do the needful.

Any help would be highly appreciated.

Thanks in advance!!


I found out the solution to my problem and no one has yet answered here so will reply to my own question.

I tried to keep a UITextView on a UIScrollView and then kept changing the width of the UItectView and added button to the left of it depending on the text added in the the textView. This will help in giving an appearance similar to that of a textfield with dynamic addition of UIButton.

Hope this wolrs for all those having the similar problem.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜