【问题标题】:Change header Background color in react native在本机反应中更改标题背景颜色
【发布时间】:2018-01-16 20:24:13
【问题描述】:

我是 React Native 的新手,并试图显示标题栏(导航栏)背景颜色。 下面尝试了一些方法。

  return (
    <View style={styles.container}>
       <NavigationBar 

  title= {titleConfig}
  />
  </View>

);

 }
}

const titleConfig = {
    title: 'XYZ',
    style: {
      backgroundColor: '#2ec76e',
  },

  };

const styles ={
    container: {
        backgroundColor: '#24686e',


    },
  }

【问题讨论】:

  • 只有标题背景颜色可以正常工作!!!

标签: css reactjs react-native


【解决方案1】:

您是否介意显示运行此程序时获得的屏幕截图 据我所知,下面的样式会做标题

container: {
    backgroundColor:'#F8F8F8',
    justifyContent:'center',
    alignItems:'center',
    height: 60,
    paddingTop: 8,
    borderWidth:0,
    shadowColor:'#F8F8F8',
    shadowOffset:{ width:0, height:2 },
    shadowOpacity:0.5,
    elevation:2,
    position: 'relative'

    },
textStyle:{
    fontSize:25

   }

【讨论】:

猜你喜欢
  • 2017-12-01
  • 2018-04-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-10-12
  • 1970-01-01
  • 2010-11-19
相关资源
最近更新 更多