Nativebase: The "size" props in Thumbnail is not working in v2.0.8

Created on 21 Feb 2017  路  9Comments  路  Source: GeekyAnts/NativeBase

After upgrading to v2.0.8, the "size" props in Thumbnail is not working. The size of Thumbnail always stays in the same size, no matter what number I set to it.

To reproduce this issue, just use the Thumbnail component like below:

<Container>
      <Content>
           <Text>Circular Thumbnail</Text>
           <Thumbnail size={80} source={require('./img/two.png')} />
      </Content>
</Container>

Most helpful comment

@sankhadeeproy007 size attribute is still in the docs: https://docs.nativebase.io/COMPONENTS.html#List_Thumbnail

All 9 comments

Hi, the size prop has been deprecated in 2.0.8. You can now pass the desired with and height with the style property. Will be updated in the docs.

In my case, I need to set the shape of Thumbnail into a circle, but only setting the width and height is not enough. I guess maybe the borderRadius of the source code hasn't been handled correctly?

When the width = height = 100
image

When the width = height = 40
image

Yes, you'll need to specify a borderRadius of half the width/height as well. Thanks for pointing out. Will be updated in the docs.

Thank you. It works!

Hi, I still have one problem. How to add borderWidth to the Thumbnail? I try to set {borderWidth: 1, borderColor: 'grey', width: 50, height: 50, borderRadius: 25}, but no border shows up.

With the placeholder image you have, I doubt a gray border would be visible. Try a different color please.

image

cardThumbNail: {
        width: width * 0.12,
        height: width * 0.12,
        borderRadius: width * 0.12 / 2,
        borderWidth: 5,
        borderColor: '#000'
    },

Still nothing happen...

Can you try it out on a regular image and check? I think this is a react-native issue

@sankhadeeproy007 size attribute is still in the docs: https://docs.nativebase.io/COMPONENTS.html#List_Thumbnail

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bsiddiqui picture bsiddiqui  路  3Comments

omerdn1 picture omerdn1  路  3Comments

muthuraman007 picture muthuraman007  路  3Comments

aloifolia picture aloifolia  路  3Comments

eggybot picture eggybot  路  3Comments