今天做小程序,在一个新增页面中, 上面是一系列input,底部有个fixex的提交按钮, 两个部分分别属于不同view,但是遇到了这样一个问题,当滚动input的部分时,发现input的placeholder悬浮在提交按钮上方。
很显然这种情况不能接受,解决问题的方法就是将按钮view的z-index来控制层级,将其的z-index变大就可以了。
.bottom-view {
position: fixed;
bottom: 0;
width: 100%;
height: 120rpx;
display: flex;
justify-content: center;
align-items: center;
border-top: 1rpx solid #ECECEC;
background-color: white;
z-index:101;
}
.mybutton {
width: 90%;
height: 90rpx;
color: white;
border-radius: 40rpx;
background-color: blueviolet;
}
修改了z-index后,问题就解决了,如果是弹窗的话需要考虑用cover-view来解决问题