iphone - ios uitextfield 类似笔记

标签 iphone ios background uitextfield

我希望我的 uitextfield 看起来像 iPhone 的笔记,黄色,带有线条。 最好的方法是什么? 提前致谢!

最佳答案

你的意思是 UItextview 对吗? ...它不是 UITextField。 但是,请清除 UITextView 上的背景。

self.textView.backgroundColor =  [UIColor clearColor];

然后创建 ImageView 并将其作为 TextView 的 subview 。

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

将图案图像设置为背景颜色。这将是你的台词。只需创建一两行即可。然后它应该重演。

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

然后将您的 subview 添加到 TextView 。

[self.textView addSubview:backgroundimage];

祝你好运!

关于iphone - ios uitextfield 类似笔记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5098682/

相关文章:

c++ - SDL,如何渲染背景图片?

javascript - UIWebView 不使用动态链接在 Button 上调用 shouldStartLoadWithRequest

ios - 如何检查以前打开的 View Controller

ios - 为多个 ViewController 未 100% 工作的 segue 问题做准备

ios - FBSDKAppInviteDialogDelegate 的 Swift 实现不起作用

ios - 如何在按下主页按钮时在 IOS 中显示顶部栏。?

html - CSS 无序列表,应用链接到背景图片

iphone - iOS sqlite 在使用 SELECT 语句时将返回 NULL

iphone - UIStringDrawing 更改字体颜色 - cocoa touch

iphone - 在 UIScrollView 中滚动 CoreText