0
나중에 데이터베이스에서 수신 할 var가있는 높이로 이미지 뷰에 애니메이션을 적용하려고합니다. 스택 및 다른 사이트를 확인했지만 적절한 대답을 찾지 못했습니다. XML을 사용하여 원하지 않습니다. 여기에 내가 이미 가지고있는 일부 코드 :ImageView의 애니메이션 높이 조정
<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
}
}
괜찮 았지 만 지금은 만든 XML 파일에 반응하고 인터넷에서 찾은 다른 모든 예제를 좋아합니다. 하지만 데이터베이스에서 변수를 얻고 애니메이션이 반응해야합니다 ... xml을 조작하는 방법이 있습니까? – user2455311
막 대형 차트의 경우 - 변수가 1000 인 경우 막대가 변수로 높이 올릴 필요가 있습니다. – user2455311