{"id":1600,"date":"2019-10-27T06:51:24","date_gmt":"2019-10-27T06:51:24","guid":{"rendered":"https:\/\/sezeromer.com\/?p=1600"},"modified":"2023-02-27T22:14:10","modified_gmt":"2023-02-27T19:14:10","slug":"xamarin-forms-gif-loading-ikonu","status":"publish","type":"post","link":"https:\/\/sezeromer.com\/en\/xamarin-forms-gif-loading-ikonu\/","title":{"rendered":"Xamarin Forms Gif Loading Icon"},"content":{"rendered":"<p>Hi friends in this article we will talk about how to add gif to our mobile application. Design is very important for our applications. If you are tired of using an activity indicator you can get over it with a gif. Not only the loading icon, you can also get beautiful screens in design. It&#8217;s really easy to use. First we need to find a gif. Here you can find many free loading gifs from the site. I&#8217;ll use the gif below as an example.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1621\" src=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2019\/09\/Infinity-1s-200px.gif\" alt=\"\" width=\"200\" height=\"200\" \/><\/p>\n<p>For this, we need to install a package to our project. This package is: <strong>FFImageLoading<\/strong>. Detailed information and source codes can be found <a href=\"https:\/\/github.com\/luberda-molinet\/FFImageLoading\">here<\/a>. I always use this package in every project. It has very useful features like cachleming photos and plache holder. After you install the package with Nuget Package Manager, you must run these packages. To do this, you must initialize the MainActivity class on the Android side in the <a href=\"https:\/\/github.com\/luberda-molinet\/FFImageLoading\">AppDelegate<\/a> for iOS. For more detailed documentation, see the source code in <a href=\"https:\/\/github.com\/luberda-molinet\/FFImageLoading\">Github<\/a>.<\/p>\n<p>After installing the package I will make a simple design on the screen. I&#8217;ll just play the gif on the black screen. To do this, I use an FFCache Image control in StackLayout and just give me the name of my gif file.<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;swift&quot;,&quot;mime&quot;:&quot;text\/x-swift&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:true,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt;\r\n&lt;ContentPage xmlns=\"http:\/\/xamarin.com\/schemas\/2014\/forms\"\r\n             xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2009\/xaml\"\r\n             xmlns:d=\"http:\/\/xamarin.com\/schemas\/2014\/forms\/design\"\r\n             xmlns:mc=\"http:\/\/schemas.openxmlformats.org\/markup-compatibility\/2006\"\r\n             mc:Ignorable=\"d\"\r\n             x:Class=\"Xam.LoadingGif.Views.MainPage\"\r\n             xmlns:ff=\"clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms\"&gt;\r\n    &lt;ContentPage.Content&gt;\r\n        &lt;StackLayout HorizontalOptions=\"FillAndExpand\"\r\n                     VerticalOptions=\"FillAndExpand\"\r\n                     BackgroundColor=\"Black\"&gt;\r\n            &lt;ff:CachedImage HorizontalOptions=\"CenterAndExpand\"\r\n                            VerticalOptions=\"CenterAndExpand\"\r\n                            WidthRequest=\"120\"\r\n                            HeightRequest=\"80\"\r\n                            Source=\"loading\" \/&gt;\r\n        &lt;\/StackLayout&gt;\r\n    &lt;\/ContentPage.Content&gt;\r\n&lt;\/ContentPage&gt;<\/pre>\n<\/div>\n<p>The output of this is as follows.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1624\" src=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2019\/10\/xam_loading.gif\" alt=\"\" width=\"325\" height=\"662\" \/><\/p>\n<p>If you have questions, you can reach us by e-mail or comment. Good work for everyone.<\/p>","protected":false},"excerpt":{"rendered":"<p>Hi friends in this article we will talk about how to add gif to our mobile application. Design is very important for our applications. If you are tired of using an activity indicator you can get over it with a gif. Not only the loading icon, you can also get beautiful screens in design. It&#8217;s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1621,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[289,1,3],"tags":[114,631,629,632,630,530,628,115,314,476,8,7,329,440,22,119],"class_list":["post-1600","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","category-c-ile-ilgili-yazilar","category-xamarin-ile-yapilmis-projeler","tag-android","tag-cache","tag-ff","tag-ff-cache-image","tag-ffcache","tag-form","tag-gif","tag-ios","tag-loading","tag-mobile","tag-omer","tag-omer-sezer","tag-programming","tag-sezer","tag-xamarin","tag-xamarin-forms"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/1600"}],"collection":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/comments?post=1600"}],"version-history":[{"count":5,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/1600\/revisions"}],"predecessor-version":[{"id":2635,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/1600\/revisions\/2635"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/media\/1621"}],"wp:attachment":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/media?parent=1600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/categories?post=1600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/tags?post=1600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}