Apple徽标显得很小。我将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)
}
这是该按钮的默认行为,还是我做错了什么? screenshot is here
答案 0 :(得分:0)
使用Apple Button登录
更多详细信息:-https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple/overview/
答案 1 :(得分:0)
我遇到了完全相同的问题,苹果公司因此拒绝了我的应用程序,他们似乎不喜欢自己的按钮,这很可悲。
我最终从以下位置下载了图标包:
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;
}