Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/122.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 反应本机:RN物料下拉列表未显示(iOS)_Javascript_React Native_React Native Android_React Native Ios - Fatal编程技术网

Javascript 反应本机:RN物料下拉列表未显示(iOS)

Javascript 反应本机:RN物料下拉列表未显示(iOS),javascript,react-native,react-native-android,react-native-ios,Javascript,React Native,React Native Android,React Native Ios,我试图在iOS中使用libreact native material下拉列表,在iPad Air上运行,但该下拉列表没有显示在屏幕上。我试着输入一个带有负值和宽度值的marginTop,但没有效果。遵循我的类代码和我使用的版本: 注册护士版本:0.55 RN材料下拉版本:0.11.1 我的班级代码: DetailProduct.js {/*导入*/} 导出默认类DetailProduct扩展React.Component{ 建造师(道具){ 超级(道具); 此.state={ 大小:[{valu

我试图在iOS中使用libreact native material下拉列表,在iPad Air上运行,但该下拉列表没有显示在屏幕上。我试着输入一个带有负值和宽度值的marginTop,但没有效果。遵循我的类代码和我使用的版本:

注册护士版本:0.55 RN材料下拉版本:0.11.1 我的班级代码:

DetailProduct.js

{/*导入*/}
导出默认类DetailProduct扩展React.Component{
建造师(道具){
超级(道具);
此.state={
大小:[{value:'Eleonora'},{value:'Barbosa'},{value:'Rafaela'}],
};
}
{/* ... */}
render(){
返回(
{
}}activeOpacity={0.9}>
塔曼霍:男性独角兽
{/* ... */}
);
}
}
constyles=StyleSheet.create({
容器:{
弹性:1,
填充:30,
背景颜色:'#f5',
flexDirection:'列',
},
基本内容:{
flexWrap:“wrap”,
身高:90%,
玛金托普:90,
flexDirection:'行',
},
内容左:{
flexDirection:'列',
宽度:“50%”,
高度:“100%”,
flexWrap:“wrap”,
marginRight:“2%”,
阴影颜色:'#212121',
阴影偏移:{宽度:0,高度:3},
阴影不透明度:0.16,
},
内容权:{
宽度:“46%”,
flexWrap:“wrap”,
保证金余额:“2%”,
},
基本尺寸:{
宽度:“48%”,
对齐项目:“居中”,
marginRight:8,
自我定位:“拉伸”,
flexDirection:'行',
},
txtSizeProduct:{
颜色:“#FFFFFF”,
尺寸:12,
},
缩编:{
宽度:12,
身高:11,
位置:'绝对',
右:15,
排名:3
},
icSize:{
宽度:17,
身高:17,
marginRight:6,
resizeMode:“包含”
},
});

我想你可以试用React钩子

function DetailProduct() {
  const sizes = [
    { value: "Eleonora" },
    { value: "Barbosa" },
    { value: "Rafaela" }
  ];
  return (
    /* ...*/
    <TouchableOpacity
      style={styles.baseSize}
      onPress={() => {
        <View
          style={{
            width: 200,
            backgroundColor: "#BDBDBD",
            marginTop: -15,
            justifyContent: "flex-start"
          }}
        >
          <Dropdown
            label="Favorite Fruit"
            itemCount={4}
            containerStyle={{ borderWidth: 1, borderColor: "lightgrey" }}
            dropdownPosition={50}
            data={sizes}
          />
        </View>;
      }}
      activeOpacity={0.9}
    >
      /*...*/
    </TouchableOpacity>
    /* ... */
  );
}

const styles = StyleSheet.create({ 
/*...*/
});
函数详细信息产品(){
常数大小=[
{value:“Eleonora”},
{value:“Barbosa”},
{值:“拉斐拉”}
];
返回(
/* ...*/
{
;
}}
activeOpacity={0.9}
>
/*...*/
/* ... */
);
}
constyles=StyleSheet.create({
/*...*/
});

baseProductDetail样式在哪里?@Sarmad here:baseProductDetails:{宽度:“94%”,高度:“22%”,flexWrap:'wrap',flexDirection:'column',},使用本机基本库。是最好的
function DetailProduct() {
  const sizes = [
    { value: "Eleonora" },
    { value: "Barbosa" },
    { value: "Rafaela" }
  ];
  return (
    /* ...*/
    <TouchableOpacity
      style={styles.baseSize}
      onPress={() => {
        <View
          style={{
            width: 200,
            backgroundColor: "#BDBDBD",
            marginTop: -15,
            justifyContent: "flex-start"
          }}
        >
          <Dropdown
            label="Favorite Fruit"
            itemCount={4}
            containerStyle={{ borderWidth: 1, borderColor: "lightgrey" }}
            dropdownPosition={50}
            data={sizes}
          />
        </View>;
      }}
      activeOpacity={0.9}
    >
      /*...*/
    </TouchableOpacity>
    /* ... */
  );
}

const styles = StyleSheet.create({ 
/*...*/
});