ReactNative

ReactNative 之 Alert 两个按钮方式 - RN

2020-08-27  本文已影响0人  survivorsfyh

日常开发中 Alert 提示框的样式经常会使用到,如下简单实现一个 ReactNative 的 Alert 两个按钮方式的样式实现,具体 code 如下:

const nav = useCallback(async => {
    return Alert.alert('提示', '具体提示信息内容', [{
        text : '确定',
        onPress : () => {
        },
    }, {
        text : '取消',
        onPress : () => {
        },
    }], {cancelable: false});
}, []);

return (
    <View
        style={style.examStationCellStyle}
        onTouchEnd={nav}
    >
        <Text style={{ color : '#51ABFF', fontSize : 48, fontWeight : 'bold' }}>{item.stationidname}</Text>
        <Text style={{ color : '#9B9B9B', fontSize : 28, marginTop : 20 }}>{item.subjectidname}</Text>
        <Text style={{ color : '#9B9B9B', fontSize : 28, marginTop : 10 }}>{item.subjectid}</Text>
    </View>
);

简单记录使用方法,便于日后查看,同时也分享给需要的朋友。


以上便是此次分享的全部内容,希望能对大家有所帮助!

上一篇 下一篇

猜你喜欢

热点阅读