Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 使用UITextfield模拟twitter boostrap表单控件_Iphone_Uitextfield_Controls_Twitter Bootstrap - Fatal编程技术网

Iphone 使用UITextfield模拟twitter boostrap表单控件

Iphone 使用UITextfield模拟twitter boostrap表单控件,iphone,uitextfield,controls,twitter-bootstrap,Iphone,Uitextfield,Controls,Twitter Bootstrap,Twitter Bootstrap有一个表单控件,当处于活动模式时,它会在边框上“发光”,我想知道在带有UITextField的iPhone上是否可以实现这种效果。有人试过吗 (http://twitter.github.com/bootstrap/base-css.html 搜索表单控件)完成此操作的最简单方法可能是修改其背衬层: CALayer *theLayer = [theTextField layer]; [theLayer setBorderWidth:2.]; [theLayer

Twitter Bootstrap有一个表单控件,当处于活动模式时,它会在边框上“发光”,我想知道在带有UITextField的iPhone上是否可以实现这种效果。有人试过吗


(http://twitter.github.com/bootstrap/base-css.html 搜索表单控件)

完成此操作的最简单方法可能是修改其背衬层:

CALayer *theLayer = [theTextField layer];
[theLayer setBorderWidth:2.];
[theLayer setBorderColor:[[UIColor blueColor] CGColor]];
[theLayer setShadowColor:[[UIColor blueColor] CGColor]];
[theLayer setShadowOpacity:1.];
[theLayer setShadowRadius:5.];
[theLayer setShadowOffset:CGSizeZero];
[theTextField setClipsToBounds:NO];
IMO,这种方法的最大缺点是CALayer阴影操作速度非常慢,因此如果您正在制作动画(例如在滚动/表格视图中),这基本上是不可用的。不过,也有一些可以实现更高性能的阴影


(另外,您显然不会想要我使用的难看的深蓝色!)

实现这一点最简单的方法可能是修改其背衬层:

CALayer *theLayer = [theTextField layer];
[theLayer setBorderWidth:2.];
[theLayer setBorderColor:[[UIColor blueColor] CGColor]];
[theLayer setShadowColor:[[UIColor blueColor] CGColor]];
[theLayer setShadowOpacity:1.];
[theLayer setShadowRadius:5.];
[theLayer setShadowOffset:CGSizeZero];
[theTextField setClipsToBounds:NO];
IMO,这种方法的最大缺点是CALayer阴影操作速度非常慢,因此如果您正在制作动画(例如在滚动/表格视图中),这基本上是不可用的。不过,也有一些可以实现更高性能的阴影

(当然,你也不会想要我用的那种难看的深蓝色!)