有没有办法使用 UI Kitten 将原色设置为 Layout 组件的背景色?
Is there a way to set the primary color as the background color to the Layout component using UI Kitten?
我正在构建一个登录屏幕,使用 UI Kitten 4.0, and I want to set a background color to the Layout component 作为当前主题的主色。
Button component API 页面上没有关于此的任何参考文档。
我想实现类似下面的代码。
import React, { Component } from "react"
import { Layout, Text } from "react-native-ui-kitten"
export default class Login extends Component {
render() {
return (
<Layout primary>
<Text>Log in</Text>
</Layout>
)
}
}
- "Layout"组件中没有'primary'属性。您可以查看文档中的API:https://akveo.github.io/react-native-ui-kitten/docs/components/layout/api#layout
- 可以直接通过"style"属性:
<Layout style={{ backgroundColor: 'red' }}>
或者映射自定义:https://akveo.github.io/react-native-ui-kitten/docs/design-system/custom-component-mapping#prepare-the-boilerplate 自定义"backgroundColor"样式
我们还内置了 API 来访问主题属性。 Check the Snack
我正在构建一个登录屏幕,使用 UI Kitten 4.0, and I want to set a background color to the Layout component 作为当前主题的主色。
Button component API 页面上没有关于此的任何参考文档。
我想实现类似下面的代码。
import React, { Component } from "react"
import { Layout, Text } from "react-native-ui-kitten"
export default class Login extends Component {
render() {
return (
<Layout primary>
<Text>Log in</Text>
</Layout>
)
}
}
- "Layout"组件中没有'primary'属性。您可以查看文档中的API:https://akveo.github.io/react-native-ui-kitten/docs/components/layout/api#layout
- 可以直接通过"style"属性:
<Layout style={{ backgroundColor: 'red' }}>
或者映射自定义:https://akveo.github.io/react-native-ui-kitten/docs/design-system/custom-component-mapping#prepare-the-boilerplate 自定义"backgroundColor"样式
我们还内置了 API 来访问主题属性。 Check the Snack