[英]UIAlertController rounded rect textfield
我在設置UIAlertController
的文本字段時遇到了一些問題。
我正在使用此代碼向alertcontroller
添加一個舍入的textfield
alertcontroller
:
[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.placeholder = @"placeholder";
textField.borderStyle = UITextBorderStyleRoundedRect;
}];
但結果如下:
如何刪除外邊框和背景顏色 ? 所以它看起來像他們在本教程中所擁有的: http : //useyourloaf.com/blog/2014/09/05/uialertcontroller-changes-in-ios-8.html 。
謝謝!
嘗試將UItextView的背景顏色設置為[UIColor clearColor]
嘗試
for textField in alertController.textFields! {
if let container = textField.superview, let effectView = container.superview?.subviews.first where effectView is UIVisualEffectView {
container.backgroundColor = UIColor.clearColor()
effectView.removeFromSuperview()
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.