开发者

ios uitextfield like notes

开发者 https://www.devze.com 2023-02-13 14:48 出处:网络
I wish that my uitex开发者_C百科tfield seems like the notes of the iPhone, yellow with the lines..

I wish that my uitex开发者_C百科tfield seems like the notes of the iPhone, yellow with the lines.. what's the best way to do this? thanks in advance!


You mean UItextview right? ... its not a UITextField. However, clear your background on the UITextView.

self.textView.backgroundColor =  [UIColor clearColor];

Then create ImageView that u put as a subview to your textview.

backgroundimage = [[UIImageView alloc] initWithFrame: CGRectMake(0, -14,textView.frame.size.width, textView.fram.size.height)];

set a pattern image as backgroundColor. This will be your lines. Just create on or two lines . Then it should repeat itself.

backgroundimage.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"lines.png"];

then add your subview to the textview.

[self.textView addSubview:backgroundimage];

Good luck!

0

精彩评论

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