gif can't display on ios ?

Fei Xu 490 Reputation points
2023-05-18T02:52:42.3333333+00:00

How can i display gif animation on ios now ? VS17.5.5 .Net 6

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

Accepted answer
  1. Vahid Ghafarpour 23,385 Reputation points Volunteer Moderator
    2023-05-18T04:01:26.72+00:00

    Hi Fei,

    Did you try UIImageView?

    using UIKit;
    
    public class MyViewController : UIViewController
    {
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
    
            UIImageView imageView = new UIImageView(UIImage.FromBundle("your_gif_filename.gif"));
            imageView.Frame = new CoreGraphics.CGRect(x, y, width, height); // Set the frame for your image view
            imageView.ContentMode = UIViewContentMode.ScaleAspectFit; // Adjust the content mode as per your requirements
            
            View.AddSubview(imageView);
        }
    }
    
    
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.