Taro小程序自定义导航栏适配
比较简单的一种,重点是适配方法,可以固定顶部。
```javascript
class CustomNavBg extends Component {
constructor(props) {
super(props);
this.state={
statusBarH: 20,
toBar:44
}
}
componentWillMount(){
var that = this;
Taro.getSystemInfo({
success: function (res) {
that.setState({
statusBarH: res.statusBarHeight
})
if(res.platform=="ios"){
that.setState({
toBar:44
})
}else if(res.platform=="android"){
that.setState({
toBar:48
})
}else{
that.setState({
toBar:44
})
}
}
})
}
goback(){
// const pages = Ta