小编Tol*_*mir的帖子

如何使用动画移动和淡出任何视图

好的,所以我有一个View,其中使用以下代码对其进行动画处理:

RelativeLayout rl = (RelativeLayout) findViewById(R.id.productPage_parentLayout_RL);

ImageView iv = new ImageView( ProductPage.this );
imageLoader.DisplayImage(FULL_PRODUCT_INFO.getFirstImage(), iv);

Animation animation = new TranslateAnimation(0, helper.getDeviceWidth() - 100,0, 0);
animation.setDuration(1000);
animation.setFillAfter(true);

rl.addView(iv);
Run Code Online (Sandbox Code Playgroud)

使用此代码,视图从屏幕的左侧开始并移动到几乎结束的屏幕,但我也希望淡出视图并最终隐藏/销毁它.我试图搜索与此相关的任何内容,但找不到任何内容.

任何帮助表示赞赏.

animation android alpha move fadeout

5
推荐指数
2
解决办法
8120
查看次数

如何在Wordpress中插入数据?

我试图将数据插入名为Ships的表中,但遗憾的是它不起作用.我粘贴了代码,以便更好地了解我如何编写脚本.任何帮助深表感谢!

<?php
require_once('../../../wp-config.php');
global $wpdb;

?>

<?php

    $json_data = $_POST['info'];

    if( isset($json_data) ){

        $eniNumber  = $json_data['EniNumber'];
        $name       = $json_data['Name'];
        $startDate  = $json_data['StartDate'];
        $rows       = $json_data['Rows'];

        $table_name = $wpdb->prefix . "Ships";
        $result = $wpdb->insert( $table_name, array(
            'eniNumber' => $eniNumber,
            'name' => $name,
            'startDate' => $startDate
        ) );

        if( $result ){
            echo json_encode("Entered data successfully");
        }else{
            echo json_encode("Insertion failed");
        }

    } else {
        echo json_encode( "What happened?" );
    }

?>
Run Code Online (Sandbox Code Playgroud)

php database wordpress insert

3
推荐指数
1
解决办法
5072
查看次数

标签 统计

alpha ×1

android ×1

animation ×1

database ×1

fadeout ×1

insert ×1

move ×1

php ×1

wordpress ×1