【发布时间】:2011-02-23 23:33:43
【问题描述】:
我希望我的 uitextfield 看起来像 iPhone 的笔记,黄色的线条.. 最好的方法是什么? 提前致谢!
【问题讨论】:
标签: iphone ios background uitextfield
我希望我的 uitextfield 看起来像 iPhone 的笔记,黄色的线条.. 最好的方法是什么? 提前致谢!
【问题讨论】:
标签: iphone ios background uitextfield
你的意思是 UItextview 对吧? ...它不是 UITextField。 但是,请清除 UITextView 上的背景。
self.textView.backgroundColor = [UIColor clearColor];
然后创建您将作为子视图放入文本视图的 ImageView。
backgroundimage = [[UIImageView alloc] initWithFrame: CGRectMake(0, -14,textView.frame.size.width, textView.fram.size.height)];
将图案图像设置为背景颜色。这将是你的台词。只需创建或两行。然后它应该重复自己。
backgroundimage.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"lines.png"];
然后将您的子视图添加到文本视图。
[self.textView addSubview:backgroundimage];
祝你好运!
【讨论】:
UITextView的背景颜色设置为[UIColor colorWithPatternImage:[UIImage imageNamed:@"lines.png"];