【发布时间】:2013-10-01 20:25:27
【问题描述】:
从 iOS 7 开始,我的 textField 将不会像在早期版本的 iOS 中那样自动被“遮蔽”。我想在文本字段中添加一个 innerShadow。自 iOS 7 以来最好的方法是什么?下面的代码是我如何编码我的文本字段。你可以在这里看到 iOS 7 和 iOS 6 的区别:http://tinypic.com/view.php?pic=2ufewx0&s=5#.Uksu6hbU-8V
UITextField* sbTextField;
//[sbTextField removeFromSuperview];
for (UIView *subView in self.searchBar.subviews){
for (UIView *ndLeveSubView in subView.subviews){
if ([ndLeveSubView isKindOfClass:[UITextField class]])
{
sbTextField = (UITextField *)ndLeveSubView;
sbTextField.backgroundColor =[UIColor whiteColor];
self.navigationItem.titleView = sbTextField;
self.navigationItem.rightBarButtonItem = menuButton;
// [sbTextField removeFromSuperview];
break;
}
}
}
【问题讨论】:
标签: ios uitextfield ios7 textfield xcode5