Disable iOS8 Quicktype Keyboard programmatically on UITextView

后端 未结 6 763
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 19:02

I\'m trying to update an app for iOS8, which has a chat interface, but the new Quicktype keyboard hides the text view, so I would like to turn it off programmatically or in

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-27 19:27

    You may disable the keyboard suggestions / autocomplete / QuickType for a UITextView which can block the text on smaller screens like the 4S as shown in this example

    with the following line:

    myTextView.autocorrectionType = UITextAutocorrectionTypeNo;
    

    enter image description here enter image description here

    And further if youd like to do this only on a specific screen such as targeting the 4S

    if([[UIDevice currentDevice]userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
        if (screenHeight == 568) {
            // iphone 5 screen
        }
        else if (screenHeight < 568) {
           // smaller than iphone 5 screen thus 4s
        }
    }
    

提交回复
热议问题