开发者

Insert UImageVIew into UITextField

开发者 https://www.devze.com 2022-12-15 04:39 出处:网络
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 l

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

精彩评论

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