简体   繁体   English

如何在 iPhone 中制作两侧圆角 UITextField?

[英]How to make Two side round corner UITextField in iPhone?

I want to create uitextfield with the top left and right corner as rounded and bottom left and right corner as normal rectangle.我想创建 uitextfield,左上角和右上角为圆形,左下角和右下角为普通矩形。 Is there any way to create this kind of UITextField.有什么方法可以创建这种 UITextField。 I tried set the contentRadius property to 10.0f it gives me fully rounded rectangle textfield.我尝试将 contentRadius 属性设置为 10.0f,它为我提供了全圆角矩形文本字段。 Please help me to create a two side rounded corner textField.请帮我创建一个两侧圆角文本字段。

textField.layer.cornerRadius = 10.0f;

Add this添加这个

#import <QuartzCore/QuartzCore.h>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM