我正在尝试在包含字符而不是默认边框选项的 UITextview 周围创建自定义边框 . 关于如何实现这一点的任何指针?
UITextview
以下是我正在尝试做的一个例子 . 我敢肯定,我可以通过将它放在UITextview上来标记,但我想至少询问并查看是否有人知道如何使用自定义边框执行此操作 .
希望您需要一个图像(文本边框),满足您对 UItextView 边框的所有需求:
UItextView
然后尝试这样的事情:
[self.txtView.layer setBorderWidth:3.0]; [self.txtView.layer setBorderColor:[[UIColor colorWithPatternImage:[UIImage imageNamed:@"textedImage.png"]] CGColor]];
使用此代码 .
txtfld.layer.borderColor=[[UIColor blackColor]CGColor]; txtfld.layer.borderWidth=1.0;
并记住你的.h文件中的 import #import <QuartzCore/QuartzCore.h>
import #import <QuartzCore/QuartzCore.h>
您还可以指定RGB值 .
txtfld.layer.borderColor=[[UIColor colorWithRed:178.0f/255.0f green:178.0f/255.0f blue:178.0f/255.0f alpha:1.0] CGColor];
2 回答
希望您需要一个图像(文本边框),满足您对
UItextView
边框的所有需求:然后尝试这样的事情:
使用此代码 .
并记住你的.h文件中的
import #import <QuartzCore/QuartzCore.h>
您还可以指定RGB值 .