当前位置: 首页>>代码示例>>C#>>正文


C# ImageView.Animate方法代码示例

本文整理汇总了C#中ImageView.Animate方法的典型用法代码示例。如果您正苦于以下问题:C# ImageView.Animate方法的具体用法?C# ImageView.Animate怎么用?C# ImageView.Animate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageView的用法示例。


在下文中一共展示了ImageView.Animate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AnimateGuitarIntro

        /// <summary>
        /// Animates the guitar intro which should last 10 seconds.
        /// </summary>
        /// <param name="guitarImage">The object which contains the image of the guitar.</param>
        public void AnimateGuitarIntro(ImageView guitarImage)
        {
            int target_ScrollX = 230;
            int target_ScrollY = -5;
            float target_ScaleX = 4.5f; //5;
            float target_ScaleY = 4.5f; //5;
            int target_ScrollX_2nd = 150; //135;

            int msDuration = 4000;
			int msDelay = 1000;

            guitarImage.Animate()
                .SetDuration(msDuration)
                .SetStartDelay(msDelay)
                .ScrollX(guitarImage, target_ScrollX)
                .ScrollY(guitarImage, target_ScrollY)
                .ScaleX(target_ScaleX)
                .ScaleY(target_ScaleY)
                .WithEndAction(new Runnable(() =>
                {
                    guitarImage.Animate()
                        .SetDuration(msDuration)
                        .SetStartDelay(msDelay)
                        .ScrollX(guitarImage, target_ScrollX_2nd)
                        .WithEndAction(new Runnable(() => {
                            OnIntroAnimationFinished(this, new EventArgs());
                        }))
                        .Start();
                }))
                .Start();
        }
开发者ID:sagisprojects,项目名称:Virtual-Guitar-Teacher,代码行数:35,代码来源:NotesPlayer.cs

示例2: InitLayout

 void InitLayout(string categoryId) {
     SetContentView(Resource.Layout.activity_quiz);
     icon = FindViewById<ImageView>(Resource.Id.icon);
     int resId = Resources.GetIdentifier(ImageCategory + categoryId, CategoryAdapter.Drawable,
         ApplicationContext.PackageName);
     icon.SetImageResource(resId);
     icon.SetImageResource(resId);
     icon.Animate()
         .ScaleX(1)
         .ScaleY(1)
         .Alpha(1)
         .SetInterpolator(interpolator)
         .SetStartDelay(300)
         .Start();
     quizFab = FindViewById<FloatingActionButton>(Resource.Id.fab_quiz);
     quizFab.SetImageResource(Resource.Drawable.ic_play);
     quizFab.Visibility = savedStateIsPlaying ? ViewStates.Gone : ViewStates.Visible;
     quizFab.Click += (sender, e) => {
         var view = (View)sender;
         switch (view.Id) {
             case Resource.Id.fab_quiz:
                 StartQuizFromClickOn(view);
                 break;
             case Resource.Id.submitAnswer:
                 SubmitAnswer();
                 break;
             case Resource.Id.quiz_done:
                 FinishAfterTransition();
                 break;
             case Undefined:
                 var contentDescription = view.ContentDescription;
                 if (contentDescription != null && contentDescription == GetString(Resource.String.up)) {
                     OnBackPressed();
                     break;
                 }
                 break;
             default:
                 throw new InvalidOperationException(
                     "OnClick has not been implemented for " + Resources.GetResourceName(view.Id));
         }
     };
     quizFab.Animate()
         .ScaleX(1)
         .ScaleY(1)
         .SetInterpolator(interpolator)
         .SetStartDelay(400)
         .Start();
 }
开发者ID:raulma,项目名称:monodroid-samples,代码行数:48,代码来源:QuizActivity.cs


注:本文中的ImageView.Animate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。