navigationBar颜色渐变

找了一下都没讲到,最后才发现这样就行了

app.json

 "window":{
    "navigationStyle": "custom",
    "enablePullDownRefresh": true
  },

 app.wxss

.ns {
   width: 100%;
   height: 135rpx;
   text-align:center;
   line-height: 155rpx; 
   color: white;
   font-weight:bold;
   background:linear-gradient(to right, rgb(173, 225, 255) , #614AF8);
}

然后直接在

<!--index.wxml-->

<view class="ns"> 颜色渐变

</view>
发布了36 篇原创文章 · 获赞 69 · 访问量 9万+

猜你喜欢

转载自blog.csdn.net/xchaha/article/details/81358509