react-native在按钮上显示触摸ID视图(iOS)
问题描述:
我正在使用'create-react-native-app'和expo SDK制作react-native应用程序,我想让它在按下时显示触摸ID视图按钮。我知道,博览会客户端具有所有原生的东西,如:触摸ID,联系人。但是当我在函数中实现构建并通过按下手机上的按钮来测试它时,它会显示错误。react-native在按钮上显示触摸ID视图(iOS)
这是一个错误,我得到:
这里是代码的一部分,我与
import React, {Component} from 'react';
import {
StyleSheet,
Text,
View,
Image,
StatusBar,
TextInput,
Button
} from 'react-native';
import Expo from 'expo';
class LoginButton extends Component {
render() {
if(Expo.Fingerprint.hasHardwareAsync()) {
return (
<Button onPress={Expo.Fingerprint.isEnrolledAsync()} title="Sign In" color="#2187BA" backgroundColor=""/>
)
}
}
}
答
onPress={()=>Expo.Fingerprint.isEnrolledAsync();}
工作只是不要忘了如果它能解决您的问题,请将其标记为答案。 –