我在我的代码中使用 react-native-awesome-alerts 。在警报消息中,我想将文本分成新行
它应该像下图
请帮我怎么做
这是我的代码
import React, { Component } from 'react';
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
import AwesomeAlert from 'react-native-awesome-alerts';
export default class Alert extends Component {
constructor(props) {
super(props);
this.state = { showAlert: false };
}
showAlert = () => {
this.setState({
showAlert: true
});
};
hideAlert = () => {
this.setState({
showAlert: false
});
};
render() {
const { showAlert } = this.state;
return (
<View style={styles.container}>
<Text>I'm AwesomeAlert</Text>
<TouchableOpacity onPress={() …Run Code Online (Sandbox Code Playgroud) 什么是 redux-loop 以及在 React Native 应用程序中使用它的主要目的是什么?
我正在使用 react-native-radio-button 来实现一个带有单选按钮的平面列表,如图所示。
[![在此处输入图像描述][1]][1]
但我无法在平面列表中一次选择一个单选按钮。
这是我的代码
import React from 'react';
import { StyleSheet, View, Text, FlatList, TouchableOpacity, Image, LayoutAnimation, UIManager, Platform } from 'react-native';
import RadioButton from 'react-native-radio-button';
import PHARMACY from './api/mockPharmacyList';
import { Colors, Fonts } from '../../styles';
interface IState {
selected: number;
selectedIndex: number;
data: any;
expanded: boolean;
checked: boolean;
}
export class TransferToPharmacy extends React.Component<{}, IState> {
constructor(props) {
super(props);
this.state = {
data: PHARMACY,
selected: 0,
selectedIndex: 0,
expanded: true,
checked: false,
};
this.onPress = this.onPress.bind(this); …Run Code Online (Sandbox Code Playgroud)