Cocina

Cocina

  • 文档
  • UI组件
  • API
  • 帮助
  • 博客

›组件

起步

  • 集合

组件

  • 结构
  • 手风琴
  • 浮动弹层
  • 角标
  • 按钮
  • 卡片
  • 复选框
  • 日期选择
  • 滑动的卡片
  • 浮动按钮
  • 底部选项卡
  • 表单
  • 顶部栏
  • 图标
  • 列表
  • 选择器
  • 单选
  • 搜索栏
  • 分段器
  • 加载器
  • 缩略图
  • 吐司
  • 标题大小
  • 抽屉滑动
  • 关联组件

图标

Icon 图标

由NativeBase驱动的完美,清晰,高清图标和像素理想字体,这是一个回购列表,列出了可用react-native-vector-icons图标系列的图标

  • 点击查看更多图标

句法

import React, { Component } from 'react';
import { Container, Header, Content, Icon } from 'native-base';
export default class IconExample extends Component {
  render() {
    return (
      <Container>
        <Header />
        <Content>
          <Icon name='home' />
          <Icon ios='ios-menu' android="md-menu" style={{fontSize: 20, color: 'red'}}/>
          <Icon type="FontAwesome" name="home" />
        </Content>
      </Container>
    );
  }
}
  • Icon 可以采用以下任何两个属性:name,ios,android。
  • 如果你想要包含自定义颜色,大小等图标,那么应该进入style。
  • NativeBase图标库中的所有图标都是可缩放的矢量图标,可以根据大小,颜色等进行自定义。

属性:

属性默认值选项描述
name--Name of the icon.
ios--Name of the icon for iOS devices.
android--Name of the icon for Android devices.
activetruebooleanRenders filled icons
colorblackuser-definedRenders icon with defined color.Include this prop within style
fontSize27user-definedRenders icon with defined icon-size.Include this prop within style
typeIoniconsIonicons, Entypo, EvilIcons, Feather, FontAwesome, Foundation, MaterialIcons, MaterialCommunityIcons, Octicons,SimpleLineIcons, ZocialSpecifies icon family from IonIcons
← PreviousNext →
  • Icon 图标
Cocina
Docs
Getting Started (or other categories)Guides (or other categories)API Reference (or other categories)
Community
User ShowcaseStack OverflowProject ChatTwitter
More
BlogGitHubStar
Facebook Open Source
Copyright © 2019 Your Name or Your Company Name