0

後でデータベースから受け取るvarを使用して、高さのイメージビューをアニメーション化しようとしています。スタックや他のサイトをチェックしましたが、適切な答えが見つかりませんでした。xml を使用したくありません。ここに私がすでに持っているいくつかのコードがあります:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <ImageView
        android:id="@+id/background"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/enkelzijdig" />

    <ImageView
        android:id="@+id/bar1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="75dp"
        android:layout_marginTop="150dp"
        android:src="@drawable/animatiebalk" />


    </RelativeLayout>





**than where the magic should happen:**





    package com.example.grafiek;



    import android.app.Activity;
    import android.os.Bundle;
    import android.view.Window;
    import android.widget.ImageView;


    public class MainActivity extends Activity{

    ImageView balk1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_main);

        balk1 = (ImageView)findViewById(R.id.balk1);

    }


    public void ScaleAnimation (float fromX, float toX, float fromY, float toY){

                no clue what to do


    }

     }
4

1 に答える 1