【问题标题】:How to activate the Keyboard when the button is clicked单击按钮时如何激活键盘
【发布时间】:2011-09-17 11:54:11
【问题描述】:

点击 UIButton 时如何激活键盘。

我有按钮 当我点击按钮时,我需要激活键盘。

默认情况下,当我单击 UITextField 时,它将激活..

UIButton 时如何实现。只需单击一个按钮即可显示键盘。

@谢谢大家。提前

【问题讨论】:

    标签: iphone objective-c ipad keyboard


    【解决方案1】:

    致电becomeFirstResponder

    [myTextField becomeFirstResponder];
    

    在显示后将从键盘接收输入的字段上。

    【讨论】:

      【解决方案2】:
      - (IBAction)buttonTapped:(id)sender
      {
           [myTextField becomeFirstRespoder];
      }
      

      【讨论】:

        猜你喜欢
        • 2015-03-27
        • 2023-03-27
        • 2012-09-21
        • 1970-01-01
        • 2021-03-10
        • 1970-01-01
        • 1970-01-01
        • 2011-05-01
        • 2021-08-29
        相关资源
        最近更新 更多