I try using below code (a Form
inside a Card
component)
(我尝试使用以下代码( Card
组件内的Form
))
<Card>
<CardItem header style={{ backgroundColor: 'lightgray' }}>
<Right>
<Text>This is Right align text </Text>
</Right>
<Badge primary>
<Text>step 1</Text>
</Badge>
</CardItem>
<CardItem>
<Body>
<Text style={{color: 'red'}}>{this.state.error}</Text>
<Form style={{alignSelf: 'stretch'}}>
<Item>
<Label>number:</Label>
<Input keyboardType="numeric"/>
</Item>
<Item>
<Label>date:</Label>
<Input />
</Item>
<Item>
<Label>number 2:</Label>
<Input keyboardType="numeric"/>
</Item>
<Item>
<Label>date 2:</Label>
<Input />
</Item>
<Button success block
>
<Text>submit</Text>
<Icon name='check' size={20} color="#FFFFFF"/>
</Button>
</Form>
</Body>
</CardItem>
</Card>
But in my device Nexus 7 Tab with android 5 footer not visible.
(但是在我的设备上,带有android 5页脚的Nexus 7 Tab无法显示。)
Do you have any suggestion for find the issue and fix it? (您是否有任何发现问题的建议并加以解决?)
I'm using NativeBase 2.0.12
and React-Native 0.42.0
. (我正在使用NativeBase 2.0.12
和React-Native 0.42.0
。)
I think it's maybe related to this issue: https://github.com/GeekyAnts/NativeBase/issues/668
(我认为这可能与此问题有关: https : //github.com/GeekyAnts/NativeBase/issues/668)
Try 1: I change my code a little and add style={{backgroundColor: 'red'}}
for CardItem
that not appear and find it on the outer card component.
(尝试1:我稍微修改一下代码,然后为未出现的CardItem
添加style={{backgroundColor: 'red'}}
,并在外部卡组件上找到它。)
This is my new code: (这是我的新代码:)
<Card>
<CardItem header style={{ backgroundColor: 'lightgray' }}>
<Right>
<Text>This is Right align text </Text>
</Right>
<Badge primary>
<Text>step 1</Text>
</Badge>
</CardItem>
<CardItem style={{backgroundColor: 'red'}}>
<Body>
<Text style={{color: 'red'}}>{this.state.error}</Text>
<Form style={{alignSelf: 'stretch'}}>
<Item>
<Label>number:</Label>
<Input keyboardType="numeric"/>
</Item>
<Item>
<Label>date:</Label>
<Input />
</Item>
<Item>
<Label>number 2:</Label>
<Input keyboardType="numeric"/>
</Item>
<Item>
<Label>date 2:</Label>
<Input />
</Item>
<Button success block
>
<Text>submit</Text>
<Icon name='check' size={20} color="#FFFFFF"/>
</Button>
</Form>
</Body>
</CardItem>
</Card>
And this is new screenshot:
(这是新的屏幕截图:)
When I remove Form
component from CardItem
it's render successfully like below:
(当我从CardItem
删除Form
组件时,它成功呈现,如下所示:)
<Card>
<CardItem header style={{ backgroundColor: 'lightgray' }}>
<Right>
<Text>This is Right align text </Text>
</Right>
<Badge primary>
<Text>step 1</Text>
</Badge>
</CardItem>
<CardItem style={{backgroundColor: 'red'}}>
<Body>
<Text style={{color: 'red'}}>{this.state.error}</Text>
</Body>
</CardItem>
</Card>
Why we can't use Form
inside CardItem
?
(为什么我们不能在CardItem
使用Form
?)
Is it an undocumented limitation of Card
component? (Card
组件是否有未记录的限制?)
ask by b24 translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…