Maa*_*eaL 0 uibutton uitextfield ios
可以在UITextField做代码此UI单独或者我需要使用的图像或使用其他组件的呢?像按钮,标签。

尝试这个。
UIImageView *imgViewForDropDown = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 35, 35)];
imgViewForDropDown.image = [UIImage imageNamed:@"dropDown.png"];
yourTextField.rightView = imgViewForDropDown;
yourTextField.rightViewMode = UITextFieldViewModeAlways;
Run Code Online (Sandbox Code Playgroud)
对于Swift代码:
let imgViewForDropDown = UIImageView()
imgViewForDropDown.frame = CGRect(x: 0, y: 0, width: 30, height: 48)
imgViewForDropDown.image = UIImage(named: "ic_keyboard_arrow_down_white")
yourTextField.rightView = imgViewForDropDown
yourTextField.rightViewMode = .always
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1504 次 |
| 最近记录: |