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

  • 相关阅读:
    PouchContainer Goroutine Leak 检测实践
    CDN全站加速助力企业云上升级
    互联网架构如何促进数字化营销
    设计模式之模板方法
    设计模式之外观模式
    设计模式之适配器模式
    分布式理论(一)CAP 理论
    边缘计算基本概念
    MQTT实战之MQTT入门
    高性能NIO通信框架之Netty架构总结(1)
  • 原文地址:https://www.cnblogs.com/yushunwu/p/2686582.html
Copyright © 2011-2022 走看看