Skip to content

ShashankSingh234/Xamarians

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loader

Cross platform library to change loader image.

You can integrate the loader in Xamarin Form application using following code:

Shared Code -

using Xamarians;

...

StackLayout loaderLayout = await Loader.RegisterLoader(this, Image name with extention, Message to show with loader);

...

loaderLayout.IsVisible = true; //This will present the loader layout.

...

loaderLayout.IsVisible = false; //This will hide the loader layout.

Android -

  1. Add loader image in Assets folder.

  2. Add dependency service as given below.

using Xamarians.Interfaces;

...

[assembly: Xamarin.Forms.Dependency(typeof(GifImageUrl))]

...

public class GifImageUrl : IGif
{
    public string GetGifImageUrl()
    {            
        return "file:///android_asset/";
    }
}

iOS -

  1. Add loader image in the Resources folder.

  2. Add dependency service as given below.

using Xamarians.Interfaces;

...

[assembly: Xamarin.Forms.Dependency(typeof(GifImageUrl))]

...

public class GifImageUrl : IGif
{
    public string GetGifImageUrl()
    {            
        return Foundation.NSBundle.MainBundle.BundlePath;
    }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages