Skip to content

Instantly share code, notes, and snippets.

@chz07
chz07 / Animation Fade
Created March 9, 2016 21:09 — forked from aloisdeniel/Animation Fade
Xamarin.iOS view common animations
public static void Fade (this UIView view, bool isIn, double duration = 0.3, Action onFinished = null)
{
var minAlpha = (nfloat)0.0f;
var maxAlpha = (nfloat)1.0f;
view.Alpha = isIn ? minAlpha : maxAlpha;
view.Transform = CGAffineTransform.MakeIdentity ();
UIView.Animate (duration, 0, UIViewAnimationOptions.CurveEaseInOut,
() => {
view.Alpha = isIn ? maxAlpha : minAlpha;
@chz07
chz07 / UILabelExtension.cs
Created February 29, 2016 04:31 — forked from benhenderson/UILabelExtension.cs
Extension for Xamarin.iOS that gives UILabel the ability resize its text to fit within its frame. Ported from this Stack Overflow answer: http://stackoverflow.com/a/15484031/1098404.
using System;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using System.Drawing;
namespace Mapco.iOS
{
public static class UILabelExtension
{
public static void AdjustFontSizeToFit (this UILabel label)