android图像视图缩放动画
嗨,我想知道如何缩放动画的标志和移动其位置 我有一个if语句,运行一些检查,然后当它完成时,我希望它缩小图像视图(徽标)并将其向上移动 这是我的布局android图像视图缩放动画,android,animation,Android,Animation,嗨,我想知道如何缩放动画的标志和移动其位置 我有一个if语句,运行一些检查,然后当它完成时,我希望它缩小图像视图(徽标)并将其向上移动 这是我的布局 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:l
<?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"
android:background="@drawable/bg_default" >
<ImageView
android:id="@+id/su_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="34dp"
android:src="@drawable/su_logo"
android:contentDescription="@string/cd_su_logo"/>
<ImageView
android:id="@+id/su_shirts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:src="@drawable/su_shirts"
android:contentDescription="@string/cd_su_shirts" />
</RelativeLayout>
这是我的java
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_initialsetup);
preChecks();
}
public void preChecks(){
//check for internet connection
//check version
String curVersion = getResources().getString(R.string.app_versionCode);
int curVer = Integer.parseInt(curVersion);
String LiveVersion = "100";
int liveVer = Integer.parseInt(LiveVersion);
if(curVer < liveVer) Log.v("setup", "There is a new version");
else {
//scale animation
}
}
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.layout\u初始设置);
预检查();
}
公共无效预检查(){
//检查互联网连接
//检查版本
String curVersion=getResources().getString(R.String.app_versionCode);
int curVer=Integer.parseInt(曲线版本);
字符串LiveVersion=“100”;
int liveVer=Integer.parseInt(LiveVersion);
如果(curVer
您可以通过在AnimationSet
// Scaling
Animation scale = new ScaleAnimation(fromXscale, toXscale, fromYscale, toYscale, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
// 1 second duration
scale.setDuration(1000);
// Moving up
Animation slideUp = new TranslateAnimation(fromX, toX, fromY, toY);
// 1 second duration
slideUp.setDuration(1000);
// Animation set to join both scaling and moving
AnimationSet animSet = new AnimationSet(true);
animSet.setFillEnabled(true);
animSet.addAnimation(scale);
animSet.addAnimation(slideUp);
// Launching animation set
logo.startAnimation(animSet);
在视图中显示ImageView的后期动画属性时,保持ImageView显示的最佳方法是什么?