不管是flex布局还是line-height布局,view在真机上都不能垂直居中,而button可以。但是官方button默认样式又一堆,能不能把view兼容性改好?
<!-- pages/login/login.wxml -->
<view class=‘view-table’ >
<view class=‘view-cell’ >
<label>帐号</label>
<input type=‘text’ placeholder=‘请输入会员帐号’ ></input>
<label>密码</label>
<input type=‘password’ placeholder=‘请输入登录密码’ ></input>
<button>登录</button>
</view>
</view>
/* pages/login/login.wxss */
view{
border: 0px solid red;
width:97%;
height:1200rpx;
padding: auto;
margin: auto;
text-align: center;
vertical-align: middle;
}
.view-table{
display:table;
}
.view-cell{
display:table-cell;
width:800rpx;
}
input{
border: 1px solid red;
margin:30px;
height:60px;
}