小编hai*_*rok的帖子

在webview内容被JavaScript修改后,Android WebView不会刷新

我的应用程序使用WebView透明背景,其中元素的一些样式属性由JavaScript修改.

问题:WebView根据修改后的属性不刷新.何时WebView重绘(例如,由于用户方向改变),WebView正确更新.我在Android 3.2(在Samsung GT上)上重现了这个问题,但在Android 2.1和4.3上都可以正常工作.

重现问题的示例代码:
显然,当第一个图像被点击时,它应该消失,点击第二个图像应该移动它.如果将背景颜色WebView更改为不透明,或者如果我删除下面显示的图像,则WebView所有工作正常...

Web视图加载的HTML.:

<!DOCTYPE html>
<html>
    <body >     
        <img style="position:absolute;left:0px" onclick="this.style.display='none';" 
            src="http://flv.justad.tv/gallery/assets/trickplay/justad/tp-pause.png" />  

        <img style="position:absolute;left:200px" onclick="this.style.top='200px';" 
            src="http://flv.justad.tv/gallery/assets/trickplay/justad/tp-ff.png" />

    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

布局文件:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    >

     <ImageView
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:scaleType="fitXY"
                android:src="@drawable/display_background" />

    <RelativeLayout android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:id="@+id/WebviewContainer">

    </RelativeLayout>

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

申请Activity:

    public class TestImageMoveActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        RelativeLayout webviewContainer =        
                  (RelativeLayout)findViewById(R.id.WebviewContainer); …
Run Code Online (Sandbox Code Playgroud)

android android-widget android-webview

18
推荐指数
1
解决办法
4001
查看次数

Hive Table添加分区以加载所有子目录

我正在使用配置单元(带外部表)来处理存储在amazon S3上的数据.

我的数据分区如下:( group/team/dt/例如,数据文件可以存储在路径中group=myGroup/team=myTeam/dt=20120603)

我想处理几个团队(不同组)的数据.由于RCOVER PARTITIONS需要很长时间,因此我想基于组和团队值将多个分区添加到hive表中(即,给定该团队中所有可用日期的组和团队负载数据).

我正在寻找的功能是:

CREATE EXTERNAL TABLE myData(
attr1 string, attr2 string, attr3 string)
PARTITIONED BY (group string, team string, dt string )
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
LOCATION 's3://myBucket/${DATA_ROOT_DIR}'; 

-- Add paritions without specifying values for dt
ALTER TABLE myData ADD PARTITION (group='group1',team='team1') ; 
ALTER TABLE myData ADD PARTITION (group='group2',team='team2') ;
Run Code Online (Sandbox Code Playgroud)

谢谢!

hadoop hive amazon-emr emr

4
推荐指数
1
解决办法
1万
查看次数