在 AWS Auth UI 中,当我单击用户名文本字段时,它会将字段移出 View 。这在 Plus 和常规尺寸的设备上都会发生。我正在使用 XCode 9.3 和 Swift 4.1。
这是我下面调用 AWSAuthUIViewController 的代码。
if !AWSSignInManager.sharedInstance().isLoggedIn {
let config = AWSAuthUIConfiguration()
config.enableUserPoolsUI = true
config.backgroundColor = .black
config.isBackgroundColorFullScreen = true
config.logoImage = #imageLiteral(resourceName: "LogoBlack")
config.canCancel = true
AWSAuthUIViewController.presentViewController(with: self.navigationController!,
configuration: config,
completionHandler: { (provider: AWSSignInProvider, error: Error?) in
if error != nil {
print("Error occurred: \(error)")
} else {
self.onSignIn()
}
})
您可以在 https://imgur.com/a/DFxHG 查看错误的图像- iPhone 8 Plus 模拟器。
最佳答案
这个问题似乎出现在最新版本的 AWS iOS Swift pod 中。如果您查看 AWSSignInViewController.m 从 2.6.13 到 2.6.14 的差异 here ,您会看到已经添加了用于处理软件键盘的隐藏/显示事件的代码。
TL;DR 只需为所有 AWS pod 指定版本 2.6.13,直到 Amazon 在以后的版本中解决他们的 UI 问题,如下所示:
pod 'AWSAuthCore', '2.6.13'
pod 'AWSUserPoolsSignIn', '2.6.13'
pod 'AWSAuthUI', '2.6.13'
pod 'AWSPinpoint', '2.6.13'
pod 'AWSCognito', '2.6.13'
pod 'AWSAPIGateway', '2.6.13'
pod 'AWSCognitoIdentityProvider', '2.6.13'
pod 'AWSS3', '2.6.13'
...
编辑: 这已被验证在 2.6.17
关于ios - AWS Auth UI 登录 - 键盘错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49705820/