javascript - 如何在本机基础的组件框之间创建空白
问题描述
我有一个问题是当我使用 Native Base 框架创建一个组件框时,我无法在它们之间创建空格,我尝试使用具有属性 marginbottom 的样式表但它不起作用,那么我现在该怎么办?
import React from "react";
import { StyleSheet } from "react-native";
import {
Box,
Progress,
Heading,
Center,
NativeBaseProvider,
} from "native-base";
export default function CategoryListItem(props) {
const config = {
dependencies: {
"linear-gradient": require("expo-linear-gradient").LinearGradient,
},
};
return (
<NativeBaseProvider config={config} style={styles.container}>
<Center flex={1}>
<Box
bg={{
linearGradient: {
colors: ["lightBlue.300", "violet.800"],
start: [0, 0],
end: [1, 0],
},
}}
p={12}
rounded="lg"
_text={{
fontSize: "md",
fontWeight: "bold",
color: "white",
}}
>
<Center mb={8}>
<Heading px={20}>Buy Car and buy house</Heading>
</Center>
<Progress value={45} mx={4} />
</Box>
</Center>
</NativeBaseProvider>
);
}
const styles = StyleSheet.create({
container: {
marginBottom: 16,
},
});
解决方案
推荐阅读
- javascript - 如何在数组中添加消息?
- html - 单击列后排序图标更改位置
- abap - 如何从 DB 表中选择 LRAW?
- asp.net-mvc - 将 Azure AD 身份验证添加到现有 .Net MVC 应用程序:未验证 id_token
- react-native - 从需要标头的 URL 反应本机图像
- android - 如何在颤振视频播放器中设置边框半径?
- c# - 如何从 JSON 文件反序列化 .NET Core 中封装的对象表?
- typescript - 如何从抽象类的静态方法实例化类
- c# - 如何有效地实现一对多关系?
- java - 如何从 ArrayList 中获取数据
- 在另一个班级?