Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akamud/materialspinner-xamarin
Xamarin bindings for MaterialSpinner by @ganfra
https://github.com/akamud/materialspinner-xamarin
xamarin xamarin-android xamarin-bindings xamarin-components xamarin-plugin
Last synced: 11 days ago
JSON representation
Xamarin bindings for MaterialSpinner by @ganfra
- Host: GitHub
- URL: https://github.com/akamud/materialspinner-xamarin
- Owner: akamud
- License: mit
- Created: 2015-09-23T02:02:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-13T09:59:45.000Z (about 9 years ago)
- Last Synced: 2024-12-03T16:34:16.197Z (about 1 month ago)
- Topics: xamarin, xamarin-android, xamarin-bindings, xamarin-components, xamarin-plugin
- Language: C#
- Size: 3.2 MB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# MaterialSpinner-Xamarin
![](https://raw.githubusercontent.com/akamud/MaterialSpinner-Xamarin/master/art/Icon.png)
Xamarin bindings for [MaterialSpinner](https://github.com/ganfra/MaterialSpinner) by [@ganfra](https://github.com/ganfra)Spinner with Material Design - Down to API 9
This library provides you a Spinner with the Material style. You can use it like any regular Spinner. Add floating label text, hint and error messages.
## Installing
![](https://img.shields.io/nuget/v/MaterialSpinner-Xamarin.svg?style=flat)
[NuGet package](https://www.nuget.org/packages/MaterialSpinner-Xamarin/) available:
```
PM> Install-Package MaterialSpinner-Xamarin
```## Usage
There is a sample project available [here](https://github.com/akamud/MaterialSpinner-Xamarin/tree/master/sample)
Using in a XML:
```XML
```
You can set a hint and a floating label text. If no floating label text is provided, the hint will be set instead.
You use it like a regular spinner, setting an adapter to it:
```C#
string[] ITEMS = {"Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6"};
var adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, ITEMS);
adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
var spinner = FindViewById(Resource.Id.spinner1);
spinner.Adapter = adapter;
```If you need to set an error message, you can do it the same way as an EditText:
```C#
// Activate
spinner.Error = "Error";
// Deactivate
spinner.Error = null;
```You can choose to have a scrolling animation or to set the error message on multiple lines with the `ms_multiline` attribute in XML (default is true).
## Gif example
![](https://github.com/akamud/MaterialSpinner-Xamarin/blob/master/screenshot.gif)
## License
[MIT License](https://github.com/akamud/MaterialSpinner-Xamarin/blob/master/LICENSE.md)