UITextField 無(wú)法顯示第三方輸入法情況,同時(shí)有2個(gè)UITextField,取名為:賬號(hào)和密碼,
密碼secureTextEntry = YES; 密碼frame必須在賬號(hào)下方,同時(shí)不能hidden = YES;高度必須大于1,可以enabled = NO;這樣賬號(hào)就可以禁止第三方輸入法了,但是會(huì)顯示密碼填充對(duì)話框
據(jù)說(shuō)是iOS10 才有這個(gè)功能
UITextField *nameTF = [[UITextField alloc]init];
nameTF.backgroundColor = UIColor.orangeColor;
[self.containerView addSubview:nameTF];
[nameTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.bottomAttribute).mas_offset(20);
make.left.mas_equalTo(10);
make.right.mas_equalTo(-10);
make.height.mas_equalTo(50);
}];
UITextField *pswTF = [[UITextField alloc]init];
pswTF.backgroundColor = UIColor.clearColor;
pswTF.secureTextEntry = YES;
pswTF.enabled = NO;
[self.containerView addSubview:pswTF];
[pswTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.bottomAttribute).mas_equalTo(10);
make.left.mas_equalTo(10);
make.right.mas_equalTo(-10);
make.height.mas_equalTo(1.0);
}];
圖片.png
圖片.png