set UITextField as non editable - Objective C

前端 未结 4 469
不知归路
不知归路 2020-12-16 16:49
    [Number.editable = NO];
    [Number resignFirstResponder];
    [Password.editable = NO];
    [Password resignFirstResponder];

I am getting the

4条回答
  •  时光取名叫无心
    2020-12-16 17:28

    Returning NO from shouldChangeCharactersInRange would be better choice because if text is longer than the textfield width, then above solution will give problem, because user won't be able to see all text(i.e. text hidden beyond the text field width)

提交回复
热议问题