找了一下都没讲到,最后才发现这样就行了
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>