小编per*_*nja的帖子

如何创建带有文本的圆形按钮

如何创建带有文本或字符的圆形按钮。它应该是这样的: 它应该是这样的,下图:

图片示例

到目前为止,我做了这个,但它不是那么圆:

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)

css react-native

4
推荐指数
1
解决办法
8647
查看次数

在Android上增加react-native中滑块的大小

有没有一种方法可以使滑块的按钮/拇指(绿色圆圈)更大,以设置高度和宽度。在iOS中,它看起来不错,但在Android上却很小。

在此处输入图片说明

slider react-native react-native-android

4
推荐指数
1
解决办法
4178
查看次数

在标头中使用令牌获取请求

当我在地址' 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)

javascript fetch fetch-api

3
推荐指数
2
解决办法
2万
查看次数