【问题标题】:I cannot get shadow to work on my search bar我无法让影子在我的搜索栏上工作
【发布时间】:2021-09-11 02:20:07
【问题描述】:

我的搜索栏周围没有阴影。我正在使用反应原生元素搜索栏,可以在这里找到here。我正在按照下面的代码显示的方式实现它。我假设我的 containerStyle 是你们需要看的。

非常感谢您的任何见解。我比你知道的更感激它。

 <View style={{ justifyContent: 'center', alignItems: 'center', }}>
          <SearchBar
            placeholder="Search..."
            onChangeText={this.updateSearch}
            value={search}
            round="true"
            containerStyle={styles.searchBarContainer}
            inputContainerStyle={{
              height: scale(45),
              width: scale(200),
              backgroundColor: '#FFFFFF',
              borderRadius: 10
              
            }}
            searchIcon={() => (
              <MaterialCommunityIcons
                name="glass-mug-variant"
                size={25}
                color="#87909A"
              />
            )}
            clearIcon="null"
          />
          </View>

const styles = ScaledSheet.create({
    searchBarContainer: {
      textShadowOffset: { width: 1, height: 1 },
      textShadowRadius: 2,
      textShadowColor: 'black',
      backgroundColor: '#d1cfcf',
      borderBottomColor: 'transparent',
      borderTopColor: 'transparent',
      paddingRight: scale(20),
      paddingLeft: scale(20),
             
    },
})

【问题讨论】:

    标签: reactjs react-native react-native-elements


    【解决方案1】:

    替换这一行backgroundColor: '#FFFFFF' 到这个 backgroundColor: '#e0dbdb' 或使用颜色选择器找到您选择的颜色的十六进制代码。

    【讨论】:

      猜你喜欢
      • 2014-01-30
      • 1970-01-01
      • 2012-07-26
      • 2018-04-03
      • 1970-01-01
      • 2020-05-07
      • 2020-11-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多