Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akamud/autofittextview-xamarin.android
Xamarin bindings for android-autofittextview by @grantland
https://github.com/akamud/autofittextview-xamarin.android
xamarin xamarin-android xamarin-bindings xamarin-components xamarin-plugin
Last synced: 26 days ago
JSON representation
Xamarin bindings for android-autofittextview by @grantland
- Host: GitHub
- URL: https://github.com/akamud/autofittextview-xamarin.android
- Owner: akamud
- License: mit
- Created: 2015-10-17T21:17:59.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-17T22:10:03.000Z (about 9 years ago)
- Last Synced: 2024-11-29T20:49:49.977Z (about 2 months ago)
- Topics: xamarin, xamarin-android, xamarin-bindings, xamarin-components, xamarin-plugin
- Language: C#
- Homepage:
- Size: 635 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AutoFitTextView-Xamarin.Android
![](https://raw.githubusercontent.com/akamud/AutoFitTextView-Xamarin.Android/master/art/Icon.png)
Xamarin bindings for [android-autofittextview](https://github.com/grantland/android-autofittextview) by [@grantland](https://github.com/grantland)A TextView that automatically resizes text to fit perfectly within its bounds.
## Installing
![](https://img.shields.io/nuget/v/AutoFitTextView-Xamarin.Android.svg?style=flat)
[NuGet package](https://www.nuget.org/packages/AutoFitTextView-Xamarin.Android/) available:
```
PM> Install-Package AutoFitTextView-Xamarin.Android
```## Gif example
![](https://raw.githubusercontent.com/akamud/AutoFitTextView-Xamarin.Android/master/autofit.gif)
## Using
You can use the defined AutofitTextView widget:
```XML```
You can also enable any component that has a TextView to act like a AutofitTextView using the `AutofitLayout`:
```XML
```
If you need to set it programmatically:
```C#
AutofitHelper.Create(textview):
```You can customize AutofitTextView attributes, just declare the `res-auto` namespace:
```XML
xmlns:autofit="http://schemas.android.com/apk/res-auto"
```Then you can set these attributes:
Attribute | Description
:----: | :-------:
minTextSize | Sets the minimum size the text will have, even when resizing to fit
precision | Amount of precision used to calculate the correct text size to fit within its bounds. Lower precision is more precise and takes more time
sizeToFit | Defines whether to automatically resize text to fit to the view's bounds. If set to `false` the widget will act like a normal TextView## License
[MIT License](https://github.com/akamud/AutoFitTextView-Xamarin/blob/master/LICENSE)