设置个人中心页-顶部颜色

1、修改页面配置文件

文件路径:pages/user/index.json

  1. {
  2. "navigationBarTitleText": "个人中心",
  3. "navigationBarBackgroundColor":"#ffdd00",
  4. "navigationBarTextStyle": "black"
  5. }

定义 navigationBarBackgroundColor 项的颜色值

2. 修改页面样式文件

文件路径:pages/user/index.wxss

  1. .user-header {
  2. display: flex;
  3. padding-top: 1px;
  4. width: 100%;
  5. height: 310rpx;
  6. align-content: center;
  7. background-color: #fd0;
  8. background-repeat: no-repeat;
  9. background-position: center right;
  10. background-size: auto 100%;
  11. }

定义 background-color 项的颜色值