【问题标题】:Android WebView: CSS scale doesn't hide originalAndroid WebView:CSS 比例不隐藏原始
【发布时间】:2016-07-14 19:57:46
【问题描述】:

我目前面临以下问题:

我向我的主要活动(api 级别 22)添加了一个 WebView 并加载了一些网络内容。
在某些时候,您必须从列表中选择一个或多个员工,选择的员工是通过一点变换:scale( , ) 动画来选择的。
但是,WebView 在动画期间和之后不会隐藏原始元素。

图片:http://i.imgur.com/FUAszRu.png

如您所见,原始元素,或者有时只是其中的一小部分。

这里是我使用的 css:

.employee {
    width: 100%;
    font-size: 40px;
    font-weight: bold;
    background-color: #fff;
    margin-bottom: 12px;
    padding: 70px 12px;
    text-align: center;
    box-shadow: 0 5px 30px rgba(0, 0, 0, .75);
    color: #444;
    cursor: pointer;
    -o-transition: all 1s ease;
    -ms-transition: all 1s ease;
    -moz-transition: all 1s ease;
    -webkit-transition: all 1s ease;
    transition: all 1s ease;
}

.employee.selected {
    box-shadow: 0 0 10px rgba(0, 0, 0, .75);
    background-color: #E6EE9C;
    -o-transform: scale(0.95, 0.95);
    -ms-transform: scale(0.95, 0.95);
    -moz-transform: scale(0.95, 0.95);
    -webkit-transform: scale(0.95, 0.95);
    transform: scale(0.95, 0.95);
}

这种现象同样适用于 Google Chrome (V:46.0.x) 和标准的 android 浏览器。取消选择一项会立即删除所有其他残留物。 有没有办法用 jQuery 动画而不是 CSS3 来处理这个问题?一种更新我的设备(Acer Iconia One 10 (nt.lc8ee.001))以使其正常工作而不会出现渲染问题的方法?

非常感谢!

【问题讨论】:

    标签: android css webview scaletransform


    【解决方案1】:

    现在我使用不同的 CSS 来解决这个问题。 我添加了一个包装类 + 元素:

    .employee-wrapper {
        height: 180px;
        margin-bottom: 12px;
    }
    

    并像这样修改其他类:

    .employee {
        width: 100%;
        font-size: 40px;
        line-height: 180px;
        font-weight: bold;
        background-color: #fff;
        text-align: center;
        box-shadow: 0 5px 30px rgba(0, 0, 0, .75);
        color: #444;
        cursor: pointer;
        margin-top: 0;
    }
    
    .employee.selected {
        box-shadow: 0 0 10px rgba(0, 0, 0, .75);
        background-color: #E6EE9C;
        width: 95%;
        margin: 6px 2.5%;
        line-height: 168px;
        font-size: 38px;
    }
    

    现在它看起来相同,但不同的是,它不会在我的设备上产生任何渲染问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-07
      • 2019-05-12
      • 2016-11-29
      • 1970-01-01
      • 2017-09-12
      • 1970-01-01
      • 1970-01-01
      • 2016-07-22
      相关资源
      最近更新 更多