zoukankan      html  css  js  c++  java
  • iOS 更换键盘的return键的形式

    iOS 右下角的return键有很多形式,比如发送,完成换行等,在遵循代理之后调用

    -(BOOL)textFieldShouldReturn:(UITextField *)textField{

    returnYES;
    

    } 此方法,系统默认return键的提示字为换行,我们可以在创建textfield时候修改系统return的提示

    textField.returnKeyType = UIReturnKeyDone;​

    如右图所示(此为英文版下的键盘)

    这里写图片描述 
    ​另外还有其他样式

    textField.returnKeyType = UIReturnKeySend;

    typedef NS_ENUM(NSInteger, UIReturnKeyType) {

    UIReturnKeyDefault,

    UIReturnKeyGo,//去往

    UIReturnKeyGoogle,

    UIReturnKeyJoin,//加入

    UIReturnKeyNext,//下一步

    UIReturnKeyRoute,

    UIReturnKeySearch,//搜索

    UIReturnKeySend,//发送

    UIReturnKeyYahoo,

    UIReturnKeyDone,//完成

    UIReturnKeyEmergencyCall,

    UIReturnKeyContinue NS_ENUM_AVAILABLE_IOS(9_0)

    ,};

    当然,要显示中文,还得设置info.plist中Localization native development region 为 cn​

  • 相关阅读:
    前缀和
    hdu6290奢侈的旅行
    make_pair
    New Year and Buggy Bot
    STL next_permutation 算法原理和自行实现
    前端面试题集合
    node设置cookie
    黑客与geek
    xss
    node async
  • 原文地址:https://www.cnblogs.com/sunfuyou/p/6647250.html
Copyright © 2011-2022 走看看