2

我无法从 NativeBase 更改缩略图的默认大小。我可以显示默认圆圈,即小圆圈和大圆圈,但我想显示比默认大小更大的圆圈。这是我的缩略图代码:

<Thumbnail size={200} style={{margin: 30}} source={require('../../../public/images/profile/yellow.jpg')} />

道具尺寸不起作用,缩略图仍然很小。

我的 NativeBase 版本:2.3.5

4

4 回答 4

6

Native Base Component 没有sizeprops,你应该添加widthand height,还有一件事你不应该忘记请添加borderRadius除以 2 以确保形状保持圆形

<Thumbnail style={{width: 30, height: 30, borderRadius: 30/2}} source={require('../../../public/images/profile/yellow.jpg')} />
于 2018-01-12T04:14:27.267 回答
2

您可以使用此技巧简单地增加缩略图大小。只需获取scalewith的属性即可<Thumbnail/>

只需将以下代码复制粘贴到您的应用中

<Thumbnail 
scaleX={3} scaleY={3} style={{margin: 30}} 
source={require('../../../public/images/profile/yellow.jpg')}/>

您可以根据需要更改比例值。让我知道这是否能解决您的问题。

于 2018-07-22T14:08:18.723 回答
1

NativeBase Thumbnail 组件带有尺寸smalllarge道具。您还可以设置宽度和高度以具有其他尺寸的图像

在此处输入图像描述

于 2018-01-18T05:30:52.227 回答
1

NativeBase 中的Thumbnail组件没有该size属性。尝试设置属性width和属性heightstyle

<Thumbnail style={{width: 100, height: 100, margin: 30}} source={require('../../../public/images/profile/yellow.jpg')} />
于 2018-01-01T20:20:55.507 回答