Android实现一种动画效果,从左到右慢慢的显示一张完整的图片 Android 图片,从左到右渐显 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 怎么改变坐标,我不会,你能给个demo吗? public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ImageView imageView = (ImageView) findViewById(R.id.imageView); final Animation animation = AnimationUtils.loadAnimation(this, R.anim.translate_anim); imageView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { imageView.startAnimation(animation); } }); } }<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageView" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/demo"/></LinearLayout><?xml version="1.0" encoding="utf-8"?><translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromXDelta="-100%p" android:toXDelta="100%p" android:fromYDelta="0%p" android:toYDelta="0" android:duration="5000"></translate> 简单写了一个Demo,你粘贴上去试一下。 HorizontalScrollView.smoothScrollTo();就可以搞定了 System.in.read()出问题了 一个突然想到的关于字符串输出方式的问题 编制程序 关于SliderPanel中的setPaintTicks()疑问! 请问怎样对TextArea中的文字更改字体? 老师布置的一道题目,不知道该咋作,请高手帮帮忙。 接着前天的JCheckBox问题.高手来看看. 郁闷,今天面试被问及“什么是面向对象的特点”,没答上来,散分………… 这是怎么回事? 低级问题....但....?????????? Java 实现 HTTPS客户端 的问题 property 的setProperty怎么没改变文件中的值,只是改变了内存中的值
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final ImageView imageView = (ImageView) findViewById(R.id.imageView);
final Animation animation = AnimationUtils.loadAnimation(this, R.anim.translate_anim);
imageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
imageView.startAnimation(animation);
}
});
}
}
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/demo"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXDelta="-100%p"
android:toXDelta="100%p"
android:fromYDelta="0%p"
android:toYDelta="0"
android:duration="5000">
</translate>
就可以搞定了