gpt4 book ai didi

ios - Xcode应用程序键盘看起来很拉长

转载 作者:行者123 更新时间:2023-12-01 19:55:27 31 4
gpt4 key购买 nike

我有一个iOS应用程序,该应用程序是使用Objective-C在Xcode中构建的,已发布并在应用商店中。

我注意到我的应用程序中的键盘似乎比手机上其他应用程序的默认键盘(例如内置的苹果邮件应用程序)高很多。

enter image description here

有人看过这种行为吗?

大小差异是否有任何原因,是否有任何方法可以更改我的代码或应用程序设置,以在我的应用程序中获得“适当的”默认键盘?

我在应用程序中的文本输入字段的代码如下...

    usernameField = [[UITextField alloc] initWithFrame:CGRectZero];
usernameField.borderStyle = UITextBorderStyleLine;
usernameField.backgroundColor = [UIColor whiteColor];
usernameField.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:16];
usernameField.placeholder = @"username";
usernameField.autocapitalizationType = UITextAutocapitalizationTypeNone;
usernameField.autocorrectionType = UITextAutocorrectionTypeNo;
usernameField.keyboardType = UIKeyboardTypeASCIICapable;
usernameField.returnKeyType = UIReturnKeyDone;
usernameField.spellCheckingType = UITextSpellCheckingTypeNo;
usernameField.clearButtonMode = UITextFieldViewModeWhileEditing;
usernameField.textAlignment = NSTextAlignmentCenter;
usernameField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
usernameField.delegate = self;
[self.scrollview addSubview:usernameField];

passwordField = [[UITextField alloc] initWithFrame:CGRectZero];
passwordField.borderStyle = UITextBorderStyleLine;
passwordField.backgroundColor = [UIColor whiteColor];
passwordField.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:16];
passwordField.placeholder = @"password";
passwordField.autocapitalizationType = UITextAutocapitalizationTypeNone;
passwordField.autocorrectionType = UITextAutocorrectionTypeNo;
passwordField.keyboardType = UIKeyboardTypeDefault;
passwordField.returnKeyType = UIReturnKeyDone;
passwordField.spellCheckingType = UITextSpellCheckingTypeNo;
passwordField.clearButtonMode = UITextFieldViewModeNever;
passwordField.textAlignment = NSTextAlignmentCenter;
passwordField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
passwordField.clearsOnBeginEditing = YES;
passwordField.secureTextEntry = YES;
passwordField.delegate = self;
[self.scrollview addSubview:passwordField];

最佳答案

使用正确大小的启动图像可以解决此问题。该应用程序将根据启动图像进行缩放,并为您提供适当的分辨率。

启动图片应使用以下尺寸。

  • iPhone 4s-640 * 960
  • iPhone 5,5s-640 * 1136
  • iPhone 6,7-750 * 1334
  • iPhone 6 +,7 +-1242 * 2208

  • 谢谢

    关于ios - Xcode应用程序键盘看起来很拉长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42937996/

    31 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com