【发布时间】:2022-01-24 06:59:32
【问题描述】:
启动画面工作正常,但我需要在底部添加文本并且无法实现,是否可以在底部添加文本
PS我正在使用 react native bootsplash 库
【问题讨论】:
标签: javascript android react-native splash-screen
启动画面工作正常,但我需要在底部添加文本并且无法实现,是否可以在底部添加文本
PS我正在使用 react native bootsplash 库
【问题讨论】:
标签: javascript android react-native splash-screen
您可以修改App.tsx 文件。 (可能是您项目中的另一个名称)。
以下摘自其示例:
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#F5FCFF",
},
text: {
fontSize: 24,
fontWeight: "700",
margin: 20,
lineHeight: 30,
color: "#333",
textAlign: "center",
},
bootsplash: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#F5FCFF",
},
logo: {
height: 89,
width: 100,
},
});
所以要将文本与页面底部对齐,您可以更改文本样式属性,例如:
text: {
fontSize: 24,
fontWeight: "700",
lineHeight: 30,
color: "#333",
textAlign: "center",
position: fixed,
bottom: 0,
margin-bottom: 2%, /* Add some space before the border */
}
【讨论】: