1
私は、ネイティブで開発されたアプリを持っていて、他の動的チェックボックスリストの中にダイナミックチェックボックスリストを作成する必要があります、最初のリストは正常に動作しますが、これは完全には表示されません。動的ネイティブ動的チェックボックス内の動的チェックボックス
これはコードです:
<View style ={styles.inside2}>
{
this.state.categorias.map((categoria) => {
return(
<View key={categoria.id}>
<CheckBox
title={categoria.nombre}
iconRight
checkedColor='red'
uncheckedColor='red'
checked={this.state.checkCategorias[categoria.id-1]}
containerStyle ={{backgroundColor: '#f7f7f7', borderColor: '#f7f7f7' }}
textStyle = {{fontSize: 12, color: '#787878' }}
checkedIcon = 'dot-circle-o'
uncheckedIcon = 'circle-o'
onPress = {(checked) => this.cambioCheckCat(categoria.id)}
/>
{
this.state.checkCategorias[categoria.id-1] ?
<View
style ={{backgroundColor: 'lightgray', width: '100%', height: '100%'}}
key ={categoria.id+'t'} >
<Text style = {styles.titulo2}>
Seleccione una o varias sub-categorias de {categoria.nombre}
</Text>
<View style={styles.separador} />
{
this.state.subcategorias.map((subcategoria) => {
if(subcategoria.id_categoria == categoria.id){
return(
<CheckBox
key={subcategoria.id+'s'}
title={subcategoria.nombre}
iconRight
checkedColor='red'
uncheckedColor='red'
checked={this.state.checkSubCategorias[i]}
containerStyle ={{backgroundColor: '#f7f7f7', borderColor: '#f7f7f7' }}
textStyle = {{fontSize: 12, color: '#787878' }}
checkedIcon = 'dot-circle-o'
uncheckedIcon = 'circle-o'
onPress = {(checked) => this.cambioCheckSub(subcategoria.id)}
/>
)
}
})
}
</View> : null
}
</View>
)
})
}
</View>
このショーの細線 "Selecciona UNA O VARIAS categorias ..." まで、私は単に表示されませ.MAPが、この部分を持っていた後。
編集:私は誰かが他の動的に動的にする必要がある場合には、ここでこれを左に、私は私のエラーが表示さ
申し訳ありませんが、私は、データベースからデータが悪い取得していますが、コードは正常に動作します。