You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何移除Android和iOS WebView中的日期选择器日历?

WebView中隐藏日历选择箭头的有效方案

你用的这段CSS在WebView里不生效,大概率是因为WebView的WebKit内核对伪元素的优先级或规则支持有差异,试试这几个调整方案:

  • 给选择器加上更明确的限定,绑定到具体的input类型:
    input[type="date"]::-webkit-calendar-picker-indicator {
      display: none !important;
      -webkit-appearance: none !important;
    }
    
  • 如果还是不行,尝试把箭头样式设为透明或缩小到不可见:
    input[type="date"]::-webkit-calendar-picker-indicator {
      opacity: 0;
      width: 0;
      height: 0;
      pointer-events: none;
    }
    
  • 部分旧版WebView内核可能需要搭配调整input的内边距,避免输入内容被影响:
    input[type="date"] {
      padding-right: 16px;
      background: transparent;
    }
    input[type="date"]::-webkit-calendar-picker-indicator {
      display: none !important;
    }
    

内容的提问来源于stack exchange,提问作者TheGabornator

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 19:09:54