mCloud Design Mobile

mCloud Design Mobile

  • Docs
  • API
  • Help
  • Blog

›Component

Component

  • Button
  • SegmentedControl
  • SearchBar
  • Radio
  • Checkbox
  • Badge
  • Marquee
  • Switch
  • InputItem
  • NoticeBar
  • Textarea
  • List
  • Card
  • Picker
  • Label
  • EmptyView
  • Stepper
  • Tabs
  • DatePicker
  • Modal
  • Avatar
  • ActionSheet
  • ShareSheet

First Category

  • Button
  • Fifth Document

Card

Card

Basic Example:

import React from 'react'
import { View,Dimensions } from 'react-native'
import { Card } from 'mcloud-mobile'



export default () => (
    <View
        style={{
            flex:1,
            alignItems:'center',
            backgroundColor:'#e6e6e6'
        }}
    >
        <View
            style={{
                backgroundColor:'#fff'
            }}
        >
            <View style={{
                backgroundColor:'#DEDFE0',
                width:Dimensions.get('window').width-15,
                marginLeft:15,
                height:1
            }}
            />
            <Card
                type='vertical'
                title='这是标题这是标题这是标题这是标题这是标题这是标题这是标题'
                content='这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是
              内容这是内容这是内容这是内容这是内容这是内容这是内容'
            />
            <View style={{
                backgroundColor:'#DEDFE0',
                width:Dimensions.get('window').width-15,
                marginLeft:15,
                height:1
            }}
            />
            <Card
                type='vertical'
                title='这是标题这是标题这是标题这是标题这是标题这是标题这是标题'
                titleNumberOfLines={1}
                content='这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是
              内容这是内容这是内容这是内容这是内容这是内容这是内容'
                image={{
                    uri:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1569822013704&di=1f'
                + 'aef74531d6c1ea1ccf2962cea5b166&imgtype=0&src=http%3A%2F%2Fpic21.nipic.com%2F2012'
                + '0519%2F9975192_125719517000_2.jpg'
                }}
            />
        </View>
    </View>
)

Props:

属性说明类型默认值
typeCard类型,可选值为horizontal/verticalstringredPoint
title标题string'标题'
titleStyle标题样式object-
titleNumberOfLines标题行数number-
content内容string'内容'
contentStyle内容样式object-
contentNumberOfLines内容行数number2
image图片object无
imageStyle图片样式object-
imageOnPress图片的点击回调函数(e: Object): void无
cardOnPresscard的点击回调函数(e: Object): void无
← ListPicker →
  • Basic Example:
  • Props:
mCloud Design Mobile
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