Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经添加UIImageView了UITextView使用该addSubview方法。现在我想更改光标位置,以便它开始在该UIImageview位置之后输入任何字符串。
UIImageView
UITextView
addSubview
UIImageview
我为我的自定义 UITextField 做了同样的事情。
cursor=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cursor.png"]]; CGFloat width = [myTextFied.text sizeWithFont:myTextFied.font].width; cursor.frame=CGRectMake(width+1, 7, 2, 20); [myTextFied addSubview:cursor];