zoukankan      html  css  js  c++  java
  • iOS 实现隐藏系统键盘

    实现隐藏系统键盘,显示自定义键盘吧;

    UITextfield获取焦点时,进入textFieldShouldBeginEditing方法,在这个方法中注册两个通知:

    [[NSNotificationCenter defaultCenter] addObserver:self
                                                     selector:@selector(keyboardWasShown:)
                                                         name:UIKeyboardDidShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                                     selector:@selector(keyboardWillShow:)
                                                         name:UIKeyboardWillShowNotification object:nil];

    //隐藏系统键盘

    - (void)keyboardWillShow:(NSNotification *)Notification{
        UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];
        [tempWindow setAlpha:0];
    }

    //显示自定义键盘

    - (void)keyboardWasShown:(NSNotification *) Notification{
    // 添加显示你的自定义键盘 }

  • 相关阅读:
    子序列自动机
    poj 暴力水题
    小白贪心题
    组合数+费马大/小定理
    随机数法
    vector的二维用法+前缀和
    巨思维题
    思维水题
    Codeforces Round #323 (Div. 2) D.Once Again... (nlogn LIS)
    Codeforces Round #325 (Div. 2) D. Phillip and Trains (BFS)
  • 原文地址:https://www.cnblogs.com/wuwangchuxin/p/3683089.html
Copyright © 2011-2022 走看看