如何创建带有文本或字符的圆形按钮。它应该是这样的: 它应该是这样的,下图:
到目前为止,我做了这个,但它不是那么圆:
import React, { Component } from 'react';
import { View, StyleSheet, TouchableOpacity } from 'react-native';
import { Constants } from 'expo';
import Icon from 'react-native-vector-icons/FontAwesome'; // 4.4.2
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<TouchableOpacity onPress={() => null}>
<Icon
name="chevron-left"
icon={{ name: 'rss', type: 'font-awesome' }}
style={styles.button}
size={25}
/>
</TouchableOpacity>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
paddingTop: Constants.statusBarHeight,
backgroundColor: '#ecf0f1', …Run Code Online (Sandbox Code Playgroud) 当我在地址' http:// localhost:8080/clients ' 上执行获取请求时,我需要帮助在标头中包含令牌.
现在我收到此消息"HTTP 403 Forbidden".
授权令牌1234abcd
function getAllClients() {
const myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
return fetch('http://localhost:8080/clients', {
method: 'GET',
mode: 'no-cors',
headers: myHeaders,
})
.then(response => response.json())
.then((user) => {
console.log(user.name);
console.log(user.location);
})
.catch((error) => {
console.error(error);
});
}
getAllClients();
Run Code Online (Sandbox Code Playgroud)