How do i insert UIImage on UIWebView
I’m trying to display an Animated-GIF image in a UIImageView. Because this way only the first frame is shown i wanted to try a different approach.
How can i get an Animated-GIF that is in memory (NSData) to display on a UIWebView with all frames..?
- iOS UiWebView “Frame load interrupted”
- Search to highlight text in PDF using UIWebView
- UIWebView random crash at : message sent to deallocated instance
- How do i get an image from the iOS photo library and display it in in UIWebview
- Cordova + Crosswalk iOS still using UIWebView
- UIWebView to display both local image and facebook comment
2 Solutions Collect From Internet About “How do i insert UIImage on UIWebView”
Thanks Thomas for you response, i don’t know if it works because i managed to do it myself now..
Been decoding the GIFs for more then a week now and still with no succes so i went from UIImageView to UIWebView and the following code made it work..
[self.webView loadData:gifData MIMEType:@"image/gif" textEncodingName:nil baseURL:nil];
I’ve not tried it, but something like this :
NSString *html = [NSString stringWithFormat:@"<img src='data:image/gif;base64,%@' />", [myData base64Value]; [myWebView loadHTMLString:html baseURL:nil]
You’ll need a
NSData category that implements converting to base64, that shouldn’t be difficult to find (I’ve bookmarked http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html)
edit: another way is to decode the gif, so you have an NSArray of the frames : http://pliep.nl/blog/2009/04/iphone_developer_decoding_an_animated_gif_image_in_objc
- iPhone iOS how to add a UILongPressGestureRecognizer and UITapGestureRecognizer to the same control and prevent conflict?
- Can you push a UITabBarController inside an UINavigationController
- diffrence between delegate] window] and .keyWindow?
- Shortcuts in Objective-C to concatenate NSStrings
- Swift NSUserDefaults not saving Dictionary?
- Reorder cells of UICollectionView
- How can I remove a view from navigation controller
- Social action sheet (like on iOS 6)
- MagicalRecord importFromObject: JSON with dictionary?
- TableView backgroundColor not changing
- iOS: how to register for push notifications?
- What's the relationship between thread and queue in GCD?
- How to calculate the age based on NSDate
- “Unknown class <MyClass> in Interface Builder file” error at runtime
- Creating a popover on iPhone?