【发布时间】:2014-01-05 21:13:35
【问题描述】:
我想创建一个UITextField,比如查找 iPhone。
我对@987654324@ 使用了以下代码:
UIBezierPath *maskPathBotton = [UIBezierPath bezierPathWithRoundedRect:txtSenha.bounds
byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerBottomRight
cornerRadii:CGSizeMake(8.0, 8.0)];
txtSenha.borderStyle=UITextBorderStyleNone;
CAShapeLayer *maskLayerBotton = [CAShapeLayer layer];
maskLayerBotton.frame = txtSenha.bounds;
maskLayerBotton.path = maskPathBotton.CGPath;
maskLayerBotton.fillColor=[UIColor whiteColor].CGColor;
maskLayerBotton.strokeColor=[UIColor lightGrayColor].CGColor;
maskLayerBotton.lineWidth=1.5;
[txtSenha.layer addSublayer:maskLayerBotton];
但结果并不是那么好。
在角落的笔触与其他线条略有不同。如何创建相同的UITextField。对不起,我的英语和没有图片,我没有足够的声誉来上传图片。
编辑:
来自 Find Iphone 的 UITextField
而这个,是我能做到的。
【问题讨论】:
-
完全不清楚您要做什么。您是否正在尝试创建一个具有 UITextView 外观的自定义视图,并带有框?
-
这就像两个 UITextField 在一起。我用图片链接更新帖子。
-
如果我没记错的话,它是一个在侧单元格中带有 uitextfield 的 uitableview。
-
在clearbackground颜色情况下使用图像 拍摄背景图像并在其上放置透明文本
标签: ios iphone objective-c uitextfield