css - 我如何更改 react-native-element 搜索栏的外观

标签 css react-native react-native-ios

enter image description here

在上图中,搜索框的一半被截掉了,如何使搜索框适合 View 。搜索框在一个 View 内,“主页”下方的区域在另一个 View 内。

我也不想要搜索框的大透明边框。如何去除透明区域?

<View style={styles.screenHeaderContainerBelow}>
            <SearchBar
                lightTheme
                containerStyle={{flex:1, height:undefined}}
                onChangeText={() => {}}
                placeholder='Type Here...' />
            </View>
        </View>

最佳答案

我从 the documentation for SearchBar 复制了四个例子,并通过添加 Prop inputStyle={{margin: 0}} 以及 noIcon 使格式看起来更好,从而使底部的大透明边框消失:

<SearchBar
          lightTheme
          noIcon
          inputStyle={{margin: 0}}
          onChangeText={someMethod}
          placeholder='Type Here...' />

enter image description here

尝试取出 containerStyle={{flex:1, height:undefined}} 看看是否解决了搜索框一半被截断的问题。

关于css - 我如何更改 react-native-element 搜索栏的外观,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45121970/

相关文章:

ios - 如何制作具有多个列和标题的原生 iOS UIPicker?

html - 输入类型提交值受到 css 转换属性的影响

css - 当屏幕尺寸改变时如何防止图像向下移动

react-native - 打包器的入口点

javascript - React Native - 使用覆盖贴纸保存图像

reactjs - 获取 FlatList 中所选项目的值。 -- react native

react-native - react native 文本输入键盘如何显示点而不是逗号?

html - CSS "Header Nav a"将鼠标悬停在没有脚本的字体颜色更改上

html - 合并外部 div 与内部 div 和内部 div 边框事件

react-native - React Native - 在 View 边框上而不是在内容上渲染阴影