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

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,179 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vahid Ghafarpour 20,480 Reputation points
    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