Android 动画缩放以适应屏幕宽度
我需要有一个动画,缩放视图到屏幕宽度超过1500秒。 我不知道如何做到这一点。我在网上搜索了一个小时Android 动画缩放以适应屏幕宽度,android,animation,scale,Android,Animation,Scale,我需要有一个动画,缩放视图到屏幕宽度超过1500秒。 我不知道如何做到这一点。我在网上搜索了一个小时 <set xmlns:android="http://schemas.android.com/apk/res/android" android:fillEnabled="true" android:fillAfter="true"> <scale android:interpolator="@android:anim/accelerate_decelerate_inte
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillEnabled="true"
android:fillAfter="true">
<scale
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromXScale="0"
android:toXScale="?"
android:fromYScale="1.0"
android:toYScale="1.0"
android:fillAfter="false"
/>
</set>
我最终解决了这个问题,使用了一个线程来编辑视图的宽度。这个怎么办?只需编辑出高度缩放。没关系,我用了一条线来编辑视图的宽度,很高兴你找到了答案,谢谢你发布了答案。您可能希望更详细地介绍您使用的最终代码,以便其他用户将来可以从您的解决方案中获益。
tab1.Click += delegate
{
ResetMenuItem();
animation = AnimationUtils.LoadAnimation(ApplicationContext, Resource.Animation.grow_anim1);
animation.Duration = duration;
// int width = Resources.DisplayMetrics.WidthPixels;
RelativeLayout.LayoutParams p = new RelativeLayout.LayoutParams((int)ConvertDpToPix(3f),RelativeLayout.LayoutParams.MatchParent);
selector1.LayoutParameters = p;
selector1.StartAnimation(animation);
animation.AnimationEnd+=delegate
{
drawer.CloseDrawers();
};
tabIndex=1;
};