IOS Focus on a disabled texfield -
i created 50 text fields array in scrollview i've disabled prevent user input. want auto scroll specific text field example text field 01 40 , maybe text field 40 10 press of button. manage following code:
//button pressed uitextfield *textfield = (uitextfield *)[textfieldarray objectatindex:40]; textfield.enabled = yes; [textfield becomefirstresponder]; textfield.enabled = no;
i enabling force focus , disabling it. using ios simulator works , no keyboard pop not sure whether correct way.
better use [scrollview scrollrecttovisible:(cgrect) animated:(bool)]
method
for example:
cgrect rect = textfield.frame; [scrollview scrollrecttovisible: rect animated:yes];
Comments
Post a Comment