开发者

How to implement the display and edit for some custom icons such as ":)", ":("?

开发者 https://www.devze.com 2023-03-22 18:08 出处:网络
I want to implement the input and display for some custom icons such as \":)\", \":(\", \"@name\", etc by UITextField. Maybe I can hook up the action of valueChanged for the text field to a method whi

I want to implement the input and display for some custom icons such as ":)", ":(", "@name", etc by UITextField. Maybe I can hook up the action of valueChanged for the text field to a method which scans the text. But how can I put a imageView in 开发者_StackOverflow中文版UITextField? Even if the icon is set as a subview of UITextField, how can I edit this icon(shift or remove)?


You could replace the :) with an emoji smile: http://pukupi.com/post/1964


Like this?

  NSString *emo;
  UIImage *smile;
  if ( [emo compare:@":)" options:NSCaseInsensitiveSearch] == NSOrderedSame )
    smile = [UIImage imageNamed:@"smile.png"];
0

精彩评论

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