weixin_36672132 2016-11-10 08:43 采纳率: 100%
浏览 3979
已采纳

微信小程序显示问题求大神解决

微信小程序 input标签password模式,在安卓手机上placeholder中的内容也被隐藏了
模拟器中input标签位置是居中的,未设置margin-left,在iphone上显示的是顶在最左面,但是在android手机上是居中的。在iphone手机上margin的设置基本无效,为什么?

代码如下:

 <view class="container">
    <input class="common-input" placeholder="请输入邮箱" bindinput="dataForUsername" value="{{username}}" auto-focus />
    <view class="verificationCode-view">
        <input class="verificationCode-input" placeholder="验证码" bindinput="dataForVerificationCode" value="{{verificationCode}}" />
        <button type="primary" class="sendVerificationCodeBtn" bindtap="doSenVercode">验证码</button>
    </view>
    <button type="primary" class="common-submitBtn" bindtap="doFindPwd">找回密码</button>
</view>

.container {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 200rpx 0;
  box-sizing: border-box;
} 
.common-input{
  width:80%;
  height:92rpx;
  border: 1px solid #d9d9d9;
  /*padding: 10rpx;*/
  border-radius: 3px;
}
.common-submitBtn{
  margin-top:30rpx;
  width:80%;
}
.verificationCode-view{
    width: 80%;
}
.verificationCode-input{
  width:50%;
  height:92rpx;
  border: 1px solid #d9d9d9;
  border-radius: 3px;
  margin-top: 25rpx;
  float: left;
}
.sendVerificationCodeBtn{
    width:45%;
    float:right;
    margin-top: 25rpx;
}


  • 写回答

2条回答 默认 最新

  • weixin_36672132 2016-11-11 09:54
    关注

    问题已经基本解决,placeholder的问题因为微信版本不是最新,之前版本存在bug

    其他的问题基本属于样式问题,因为好多样式设置的时候在微信小程序中不兼容
    使用微信demo中的container属性
    .container {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 200rpx 0;
    box-sizing: border-box;
    }
    align-items: center;这个属性会在iPhone上存在问题。删除就好了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 vhdl+MODELSIM
  • ¥20 simulink中怎么使用solve函数?
  • ¥30 dspbuilder中使用signalcompiler时报错Error during compilation: Fitter failed,求解决办法
  • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
  • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
  • ¥15 知识蒸馏实战博客问题
  • ¥15 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题