iphone keyboard without textview

后端 未结 4 1011
难免孤独
难免孤独 2020-12-15 01:22

is it possible to bring up the keyboard in an iphone app without a textview? or will i have to have an invisible textview?

if so, how do you programatically create a

4条回答
  •  醉酒成梦
    2020-12-15 02:03

    After some more digging, I found this. It's unofficial, but I bet it works.

    UIKeyboard *keyboard = [[[UIKeyboard alloc] initWithFrame: CGRectMake(0.0f, contentRect.size.height - 216.0f, contentRect.size.width, 216.0f)] autorelease];
            [keyboard setReturnKeyEnabled:NO];
            [keyboard setTapDelegate:editingTextView];
            [inputView addSubview:keyboard];
    

提交回复
热议问题