iPhone: UIImageView Fades in - Howto?

2020-05-19 08:20发布

I have an UIImageView that I want to fade in.

Is there a way to enable that on an underlying UIViewController?

I have translated the simplest answer, though they all work, C# .NET for the MonoTouch users:

public override void ViewDidAppear (bool animated)
{
    base.ViewDidAppear (animated);
    UIView.BeginAnimations ("fade in");
    UIView.SetAnimationDuration (1);
    imageView.Alpha = 1;
    UIView.CommitAnimations ();
}

7条回答
唯我独甜
2楼-- · 2020-05-19 08:57

this simple code:

[UIView animateWithDuration:5.0 animations:^{
        theImage.alpha = 1.0;
    }];

the UIImage is in the view and is connected via an IBOutlet you can also, set the alpha from the utility panel.

查看更多
登录 后发表回答