ios - Apple Authentication Button 使用 expo-apple-authentication 包不显示
问题描述
我正在尝试使用expo-apple-authentication包在我的 iOS 应用程序中实现 Apple 登录,但我无法显示按钮。即使我使用与文档完全相同的代码:
<AppleAuthentication.AppleAuthenticationButton
buttonType={
AppleAuthentication.AppleAuthenticationButtonType.SIGN_IN
}
buttonStyle={
AppleAuthentication.AppleAuthenticationButtonStyle.BLACK
}
cornerRadius={5}
onPress={() => {
}}
/>
值得注意的是,对 AppleAuthentication.isAvailableAsync() 的调用返回 true。
我正在模拟器中测试它。它不应该在开发环境中工作吗?那我该怎么测试呢?
解决方案
由于某些奇怪的原因,该按钮没有默认大小。应用你自己的风格修复它。
<AppleAuthentication.AppleAuthenticationButton
onPress={onSignIn}
buttonType={AppleAuthentication.AppleAuthenticationButtonType.SIGN_IN}
buttonStyle={AppleAuthentication.AppleAuthenticationButtonStyle.BLACK}
style={{ width: 200, height: 64 }} // You must choose default size
/>
推荐阅读
- node.js - 日期输入未正确输入到 nodejs 中的数据库
- python - 如何将实时 JSON 提要从 RESTful API 接收到 BigQuery?
- android - 在kotlin中连接两个字节数组的简单方法?
- java - Jsoup select方法总是返回null
- php - PHP 代码中的错误“$agent”意外
- spring-boot - EC2 上的 Kafka 集群面临“正在缩小分区的 ISR”和“缓存的 zkVersion [] 不等于 Zookeeper 中的,跳过更新 ISR”
- java - 如何从字符串中获取 ipAddresses 列表?
- angular - 某些页面中未显示离子图标
- c# - 未观察到/未等待的任务是否会影响 ASP.Net 网站性能
- android - 上传视频的文件路径为空