首页 > 解决方案 > 更新由管理的视图的属性“背景颜色”时出错:RNCardView - React Native

问题描述

我在 React Native 中使用 ios 应用程序没有任何问题,但在 android 上出现以下错误。RGB 颜色定义是必需的。Rgba 不支持颜色支持吗?

一个

 ext {
        buildToolsVersion = "29.0.1"
        minSdkVersion = 16
        compileSdkVersion = 29
        targetSdkVersion = 26
        supportLibVersion = "29.0.1"
    }
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

render() {
        return (

             <ScrollView>
              <Image source={require('../images/HEADER.png')} style={styles.imageBanner}>
      </Image>
                <View style={styles.container}>

                <CardView cardElevation={4}
                          maxCardElevation={4}
                          radius={10}
                          backgroundColor={'#ffffff'}>
                    <View style={{padding:10}}>
                                            <View>
                                             <HTML html={this.state.dataIcerik[0]} />

                        </View>

 container: {
    flex: 1,
    paddingLeft:20,
    paddingRight:20,
    paddingTop: 10,
    backgroundColor: 'rgba(248, 248, 248, 1.0)',

标签: react-native

解决方案


推荐阅读