我不知道这个动画.
我怎么能通过xml这样做呢?或其他解决方案?
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fillAfter="true">
......
</set>
Run Code Online (Sandbox Code Playgroud)
谢谢你的支持
我是新的android和我正在寻找一种方法来点击我的按钮图像.到目前为止,我得到了这个,但它一直崩溃.或者,如果你点击它没有任何作用.我希望你们能帮助我.如果我忘了任何事情只是说出来.代码可能很乱.
我有一个动画文件夹.用shakeanim.xml
码:
activity_main.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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/chest"
android:background="@null"/>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/imageButton1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="51dp"
android:text="100 Clicks" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
MainActivity.java
package com.example.egghatcher;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageButton;
import android.widget.TextView;
public class MainActivity extends Activity {
ImageButton imageButton;
TextView clicksToGo;
Animation shake;
private int clicks = 100;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
shake = …Run Code Online (Sandbox Code Playgroud) 我有一个图像按钮,我想在它被触摸时摇动/摆动.我希望它能以类似于iPhone应用程序图标的方式摆动,当它们被按下很长时间时.
谢谢!
我想在我的Android应用程序中使用Xamarin C#动画.动画,如淡入,放大,移动和....