ghi*_*boz 2 iphone background uitextfield ios
我希望我的uitextfield看起来像iPhone的笔记,黄色的线条......最好的方法是什么?提前致谢!
你的意思是UItextview对吗?...它不是UITextField.但是,请清除UITextView上的背景.
self.textView.backgroundColor = [UIColor clearColor];
Run Code Online (Sandbox Code Playgroud)
然后创建将您作为子视图放入textview的ImageView.
backgroundimage = [[UIImageView alloc] initWithFrame: CGRectMake(0, -14,textView.frame.size.width, textView.fram.size.height)];
Run Code Online (Sandbox Code Playgroud)
将图案图像设置为backgroundColor.这将是你的线.只需创建两行或两行.然后它应该重演.
backgroundimage.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"lines.png"];
Run Code Online (Sandbox Code Playgroud)
然后将您的子视图添加到textview.
[self.textView addSubview:backgroundimage];
Run Code Online (Sandbox Code Playgroud)
祝好运!