使用 Apple 按钮登录 Apple 标志显得很小

Tar*_*ğlu 10 ios swift ios13 apple-sign-in

苹果标志显得很小。我给 xib 中的 appleSignView 设置了 44px 的高度。

我正在使用的代码:

private func setupAppleSignIn() {
   let button = ASAuthorizationAppleIDButton(authorizationButtonType: .signIn, authorizationButtonStyle: .white)
   rootView.appleSignView.isHidden = false
   button.frame = rootView.appleSignView.bounds
   print(button.frame)
   rootView.appleSignView.addSubview(button)
   button.addTarget(self, action: #selector(handleAuthorizationAppleIDButtonPress), for: .touchUpInside)
}
Run Code Online (Sandbox Code Playgroud)

这是该按钮的默认行为还是我做错了什么? 截图在这里

小智 1

我有完全相同的问题,苹果因此拒绝了我的应用程序,他们似乎不喜欢自己的按钮,这很伤心。

我最终从以下位置下载了图标包:

https://developer.apple.com/design/ human-interface-guidelines/sign-in-with-apple/overview/buttons/

并创建了我自己的图标,如下所示:

    if (@available(iOS 13.0, *))
    {
        self.appleIDButton = [[UIButton alloc] initWithFrame:CGRectMake(x,
                                                                       y,
                                                                       44,
                                                                       44)];
        UIImage *appleButtonImage = [UIImage imageNamed:@"appleLogin.png"];
        [self.appleIDButton setImage:appleButtonImage forState:UIControlStateNormal];
        [self.appleIDButton addTarget:self action:@selector(handleAuthrization:) forControlEvents:UIControlEventTouchUpInside];
        self.appleIDButton.layer.borderColor = [UIColor whiteColor].CGColor;
        self.appleIDButton.layer.borderWidth = 0.5f;
        self.appleIDButton.layer.cornerRadius = 10.0f;
        self.appleIDButton.layer.masksToBounds = YES;
    }
Run Code Online (Sandbox Code Playgroud)