Mapbox IOS SDK 选择带有 TERNARY 表达式的图像不起作用

问题描述

任何人都可以帮助解决如何做到这一点吗? 我向每个集群添加一个属性,该属性汇总了所有活动的汽车,现在我需要通过该属性 (active_count) 为集群设置图像。 无论我尝试什么,我都发现它无法解析。

<Modal
    contentContainerStyle={{ backgroundColor: 'white',padding: 20,borderRadius: 10,marginLeft: 30,marginRight: 30 }}
    animationType="fade"
    visible={this.state.dialogVisible}
>
    <KeyboardAvoidingView behavior='padding' enabled>
        <Text style={styles.descDialogInqueryFor}> Inquire for </Text>
        <TextInput
            autoFocus={true}
            maxLength={50}
            underlineColorAndroid={'transparent'}
            style={styles.inpuTextDialog}
            placeholder='Name'
            placeholderTextColor='#C7C7CD'
            onChangeText={(text) => this.setState({ name: text })}
        ></TextInput>
        <TextInput

            autoCompleteType={'email'}
            maxLength={40}
            underlineColorAndroid={'transparent'}
            style={styles.inpuTextDialog}
            placeholder='Email'
            placeholderTextColor='#C7C7CD'
            onChangeText={(text) => this.validateEmail(text)}
        ></TextInput>
        <Text style={[styles.errorText,{ display: this.state.displayEmailError }]}>Invalid email address</Text>
        <TextInput

            autoCompleteType={'email'}
            maxLength={40}
            underlineColorAndroid={'transparent'}
            style={styles.inpuTextDialog}
            placeholder='Email'
            placeholderTextColor='#C7C7CD'
            onChangeText={(text) => this.validateEmail(text)}
        ></TextInput>

        <Text style={[styles.errorText,{ display: this.state.displayPhoneError }]}>Invalid phone number</Text>
        <TextInput
            maxLength={30}
            underlineColorAndroid={'transparent'}
            style={styles.inpuTextDialog}
            placeholder='Subject'
            placeholderTextColor='#C7C7CD'
            onChangeText={(text) => this.setState({ subject: text })}
        ></TextInput>
        <TextInput
            blurOnSubmit={true}
            multiline={true}
            underlineColorAndroid={'transparent'}
            style={styles.messageInpuText}
            placeholder='Message'
            placeholderTextColor='#C7C7CD'
            onChangeText={(text) => this.setState({ message: text })}
        ></TextInput>

        <Button style={styles.sendButtonDialog} onPress={() => this.sendInquire()}>
            <Text style={styles.sendButtonText}>Send</Text>
        </Button>
    </KeyboardAvoidingView>
</Modal>

我需要的是,如果集群中列出一辆活动汽车,则显示 carCluster 图像,否则显示 carClusterFinal 图像。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...