Android的缩放视图 [英] Android scale view
本文介绍了Android的缩放视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要通过百分数设置比例因子缩放视图。我需要设置完全相同的参数为ScaleAnimation用,因为我打算在未来使用ScaleAnimation扩展它。我该怎么做呢?
I need to scale View by setting the scale factor in percents. I need to set exactly the same param as ScaleAnimation use, because I'm going to scale it using ScaleAnimation in the future. How do I do it?
感谢
推荐答案
我已经通过创建具有持续时间的动画xml文件= 0,它设置所需参数,解决了这个问题。另外,也可以创建通过code这样的动画。然后,应用它,只需使用:
I've solved the problem by creating animation xml file with duration=0, which sets desired parameters. It is also possible to create such animation via code. Then to apply it, just use:
Animation animationInit = AnimationUtils.loadAnimation(context, R.anim.gallery_init);
v.startAnimation(animationInit);
这篇关于Android的缩放视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文