zoukankan      html  css  js  c++  java
  • fdfd

    And the Rest...

    general control attributes inherited from UIControl,but

    these generally don't apply to text fields,with the exception of

    the Enabled Checkbox,,won't affect the field's appearance.

    check Opaque,


    Set the Attributes for the Second Text field

    single -click the second text field in the View window, and return to the inspector.

    in the Placeholder field,type Type in a number.

    in the section called Text Input Traits

    keyboard Type pop-up menu. ince we want the user to enter numrs only.

    go ahead and select Number Pad

    we don't have to set the Return Key value for the numbeic

    keypad

    Connection Outlets

    Control-drap from File's Owner to each of the text field.

    and connect them to their corresponding outlets.

    Save the nib file once you;ve connected both text fields to their corresponding outlets and the go back

    to Xcode

    Closing the Keyboard

    how do you get the keyboard to go away?

    Go ahead and try.

    Closing the keyboard when done is Tapped

    the keyboard is software-based, we need to take a few extra steps to make sure the keyboard

    goes away when the user is finsihed with it .

    when the user taps the Done button on the text keyboard.

    a Did End On Exit event will be generated, and at that time , we need to tell the text field to tive up control so that the key board

    will go away.

    add an action method to our controller class.

    Control_FunViewController.h

    switch over to .m, we'll implement this method.


    add the following method to .m

    the first responder is the control with which the user is

    currently interacting. In our new method ,we tell our control to resign

    as a first responder, giving up that role to the previous control the user worked with.

    When a text field yields first responder status , the

    keyboard associated with it goes away.

    Double-click .xid to hop back ouer to IB and trigger this action from both of our tet field

    single click the Name text field , press 2 to bring the connecton in

    inspector  we want Did End On Exit since that is the event that will file when the uer taps the Done button on th ekeyboad

  • 相关阅读:
    使用Delphi自带的TDockTabSet组件实现停靠功能(Jeremy North)
    揭秘换肤技术(转载)
    cdecl、stdcall、fastcall函数调用约定区别(转)
    Delphi XE的RTTI增强,动态Hook某些内部事件
    sizeof和strlen解析
    由swap引出的局部变量,形参和指针的小问题
    单链表的逆置算法
    关于C++中的虚拟继承的一些总结
    关于"引用"的几点说明
    求最长公共子序列(子序列在原串中可以不连续)
  • 原文地址:https://www.cnblogs.com/yushunwu/p/2686582.html
Copyright © 2011-2022 走看看