react-native - 如何在 native react 、 native 基础中使卡片呈圆形

标签 react-native native-base

我在 native react 之上使用 native 基础组件,我想知道如何在 UI 中使卡片呈圆形而不是矩形。 有圆形的 Prop 吗?

最佳答案

好吧,实际上没有人能回答这个问题,但幸运的是我在 github 上发现了这个:

import React, { Component } from "react";
import { Container, Header, Title, Content, Button, Icon, Card, CardItem, Text, Body, Left, Right, IconNB, View } from "native-base";
export default class App extends Component {
  constructor(props) {
    super(props);
    this.state = { 
      loading: true
     };
  }
  static navigationOptions = {
    header:null
  };

  async componentWillMount() {
    await Expo.Font.loadAsync({
      Roboto: require("native-base/Fonts/Roboto.ttf"),
      Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf"),
      Ionicons: require("@expo/vector-icons/fonts/Ionicons.ttf"),
    });
    this.setState({ loading: false });
  }
  render() {
    if (this.state.loading) {
      return <Expo.AppLoading />;
    }
    else
    return (
      <Container>
        <Header>
          <Left>
            <Button transparent>
              <Icon name="arrow-back" />
            </Button>
          </Left>
          <Body>
            <Title>Header</Title>
          </Body>
          <Right />
        </Header>
        <Content padder>
          <Card style={{ borderRadius: 8 }}>
            <CardItem header bordered style={{ borderTopLeftRadius: 8, borderTopRightRadius: 8 }}>
              <Text>NativeBase</Text>
            </CardItem>
            <CardItem bordered>
              <Body>
                <Text>
                  NativeBase is a free and open source framework that enable
                  developers to build
                  high-quality mobile apps using React Native iOS and Android
                  apps
                  with a fusion of ES6.
                </Text>
              </Body>
            </CardItem>
            <CardItem bordered>
              <Body>
                <Text>
          NativeBase builds a layer on top of React Native that provides
                  you with
                  basic set of components for mobile application development.
                </Text>
              </Body>
            </CardItem>
            <CardItem bordered>
              <Body>
                <Text>
                  Get on the mobile fast track with NativeBase, the
                  fastest-growing platform
                  and tool set for iOS and Android development.
                </Text>
              </Body>
            </CardItem>
            <CardItem footer bordered style={{ borderBottomLeftRadius: 8, borderBottomRightRadius: 8 }}>
              <Text>GeekyAnts</Text>
            </CardItem>
          </Card>
        </Content>
      </Container >
    );
  }
}

谢谢阿基尔极客!!!! Here是原始帖子的链接

Here是另一个与圆角卡片背景图像相关的链接

关于react-native - 如何在 native react 、 native 基础中使卡片呈圆形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53551511/

相关文章:

javascript - React Native FlatList 水平模式根本不起作用

javascript - Native Base改变floatlabel输入底部轮廓颜色

react-native - React Native 必须双击 onPress 才能工作

css - 在原生卡中启用溢出

javascript - Azure Active Directory B2C 与 native react

javascript - React Native,创建多个复选框

javascript - 跳过不存在的对象(过滤)React-Native

javascript - 在带有 Redux 的 React Native 中使用 NetInfo 中间件

react-native - React Native 或 NativeBase Picker 可以包含包含图像的项目吗?

javascript - 动画 : `useNativeDriver` was not specified issue of ReactNativeBase Input