سؤال

I have a UItextField in a UIScrollView. I assigned an inputView (a picker) on my UITextField but it doesn't work. When I click on my textfield, I get the keyboard instead of a picker. When I delete the UIScrollView it works well (I get the picker). Do you have any ideas? Thanks.

Edit (more clear): I have a UItextField in a UIScrollView. I call a method that shows a picker. But the method is never called when my textfield is in a scrollview and I get the keyboard. When I delete the UIScrollView, my method (show picker) is called and I get my picker.

هل كانت مفيدة؟

المحلول

In case you are already using the textfield delegate, try ...

-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField 
{
    [self openCustomPicker:self]; // Call your IBAction method
    return NO;  // Hide both keyboard and blinking cursor.
}

to prevent the UITextField from showing the keyboard.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top