我目前是新的本地反应并试图使用原生基础,该组件很好但我仍然坚持改变原生基础中的主题,而我知道如何使用风格但不是所有这些都可以应用于原生基础(例如在活动页脚选项卡中更改颜色) . 即使它可以自定义风格我更喜欢在主题中更改,就像在文档中一样 . 但我无法克服这一点 .
我已经尝试使用我的自定义主题并在我的组件中应用到目前为止但它没有改变 .
我的工作区:-react-native 2.0.1 -native-base 2.3.1
谢谢
您可以使用此代码并阅读here以获取更多信息:
import React, { Component } from 'react'; import { Container, Content, Text, StyleProvider } from 'native-base'; import getTheme from './native-base-theme/components'; import material from './native-base-theme/variables/material'; export default class ThemeExample extends Component { render() { return ( <StyleProvider style={getTheme(material)}> <Container> <Content> <Text> I have changed the text color. </Text> </Content> </Container> </StyleProvider> ); } }
1 回答
您可以使用此代码并阅读here以获取更多信息: