Nativebase: How to control `Card` padding ?

Created on 16 Jun 2018  路  11Comments  路  Source: GeekyAnts/NativeBase

How to control the space between CardItem and Card ? The docs doesn't have any information about
controlling the Card padding. ?

Most helpful comment

To make all padding to zero, I gave padding:0 to CardItem, It didn't work. but this

 paddingLeft: 0,
 paddingRight: 0,
 paddingTop: 0,
 paddingBottom: 0

worked.

Do you know why ?

All 11 comments

listItemPadding from theme does that
This variable is used commonly between List and Card

Ok. thank you for the commit.

I could also fix the issue with this
<CardItem style={{ paddingLeft: 0, paddingRight: 0, paddingTop: 10, paddingBottom: 10 }} >

Result
image

@theapache64 Your query was

The docs doesn't have any information about controlling the Card padding

Which means you expected some theme variable doing this
If you wanted to do this inline, then no point in questioning docs

You can always choose between inline style and theme variable (provided consistency) for this

The docs doesn't have any information about controlling the Card padding

How could you assume that i was expecting theme variables ? Is docs means theme variable to you ?

yes ofcourse
Else how can we list down the possibility of combination of inline styles for all the components

To make all padding to zero, I gave padding:0 to CardItem, It didn't work. but this

 paddingLeft: 0,
 paddingRight: 0,
 paddingTop: 0,
 paddingBottom: 0

worked.

Do you know why ?

Fixed with 2.6.1

Hi. I'm still facing this issue for the <CardItem>.

Even paddingHorizontal and paddingVertical does not work

@theapache64's workaround works though.

Nativebase version: 2.0

To make all padding to zero, I gave padding:0 to CardItem, It didn't work. but this

 paddingLeft: 0,
 paddingRight: 0,
 paddingTop: 0,
 paddingBottom: 0

worked.

Do you know why ?

I wonder to know why, too

Was this page helpful?
0 / 5 - 0 ratings