开发者

Insert UImageVIew into UITextField

How can I add an image to a textfield? I saw it in a few apps, but can't get around开发者_开发技巧 it. Also based on the location of the curser, the imageView will be initialized (add image to next line). Thanks.


If you really mean insert an image into the text box of the textfield I don't believe this is possible. What are you trying to accomplish? There are probably more appropriate ways of doing it.


Yes We can insert imageview into textfield with the following code.

 UIImageView *myView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"text_line.png"]];
 myView.center = CGPointMake(5, 27);                     
 [letterField insertSubview:myView atIndex:0];// mgViewTitleBackGround is image
 [myView release];

Go through this code.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜