Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.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
Css 反应本机:保持图标位置固定_Css_React Native_Flexbox_React Native Stylesheet - Fatal编程技术网

Css 反应本机:保持图标位置固定

Css 反应本机:保持图标位置固定,css,react-native,flexbox,react-native-stylesheet,Css,React Native,Flexbox,React Native Stylesheet,我正在使用react本机自动完成输入组件的 但当我开始打字时,搜索和关闭图标都会被下推到建议的中心: 任何建议,我如何保持两个图标固定在它的顶部位置。 请提供帮助。请尝试样式中的属性对齐项目:'flex-start'。搜索部分 要进一步对齐图标,请在searchIcon和clearcon中使用padingTop:10,请尝试样式中的属性alignItems:'flex-start' 要进一步对齐图标,请在searchIcon和clearIcon中使用padingTop:10,谢谢@Laxmin

我正在使用
react本机自动完成输入
组件的

但当我开始打字时,搜索和关闭图标都会被下推到建议的中心:

任何建议,我如何保持两个图标固定在它的顶部位置。
请提供帮助。

请尝试
样式中的属性
对齐项目:'flex-start'
。搜索部分


要进一步对齐图标,请在
searchIcon
clearcon
中使用
padingTop:10
,请尝试
样式中的属性
alignItems:'flex-start'


要进一步对齐图标,请在
searchIcon
clearIcon
中使用
padingTop:10
,谢谢@Laxminarayan的指导。我用更精确的信息编辑了答案。谢谢@Laxminarayan的指导。我用更精确的信息编辑了答案。
       <View style={styles.searchSection}>
          <AntDesign
            name="search1"
            size={18}
            color="gray"
            style={styles.searchIcon}
          />
          <Autocomplete
            autoCapitalize="none"
            autoCorrect={false}
            containerStyle={styles.autocompleteContainer}
            inputContainerStyle={styles.inputContainer}
            //data to show in suggestion
            data={filteredFilms}
            //default value if you want to set something in input
            defaultValue={
              JSON.stringify(selectedValue) === '{}'
                ? ''
                : selectedValue.title + selectedValue.id
            }
            // onchange of the text changing the state of the query
            // which will trigger the findFilm method
            // to show the suggestions
            onChangeText={(text) => findFilm(text)}
            placeholder="Search doctors, specialities, symptoms"
            renderItem={({item}) => (
              //you can change the view you want to show in suggestions
              <View style={{backgroundColor: 'red', flexDirection: 'column'}}>
                <TouchableOpacity
                  onPress={() => {
                    setSelectedValue(item);
                    setFilteredFilms([]);
                  }}>
                  <Text style={styles.itemText}>{item.title + item.id}</Text>
                </TouchableOpacity>
              </View>
            )}
          />
          <AntDesign
            name="close"
            size={18}
            color="gray"
            style={styles.clearIcon}
          />
        </View>