Skip to content

fryette/Pulse-Control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pulsing-Control

PulseControl is a pulsing animation CALayer for UIView.

demo

Requirements

  • iOS 8.1+

Installation

NuGet

PulseControl is available through Nuget. To install use next command or Nuget manager:

Install-Package Xamarin.iOS.PulseControl

Manual

Simply copy the folder Xam.iOS.PulseControl to your project and reference to the PulseControl.csproj.

Usage

Getting Started

Via code
using Xamarin.iOS.PulseControl

Create a PulseControl object, and add it via 'myView.Layer.AddSubLayer()'. Code below insert three 'Pulse' layer to provide animation as on the sample image.

const float radius = 80;
RootView.Layer.InsertSublayer(new PulseCALayer(radius, RootView.Center) { BackgroundColor = UIColor.Red.CGColor }, 0);
RootView.Layer.InsertSublayer(new PulseCALayer(radius, RootView.Center, delay: 0.2f) { BackgroundColor = UIColor.Red.CGColor }, 1);
RootView.Layer.InsertSublayer(new PulseCALayer(radius, RootView.Center, delay: 0.4f) { BackgroundColor = UIColor.Red.CGColor }, 1);

Properties

PulseControl has a few customizable constructor parameters:

  • radius (should be positive) The radius of the pulse.

  • animationDuration (default is 1.5) The duration of the animation

  • delay (default is 0.01) The time time before the animation starts

  • nextPulseAfter (default is 0) the time interval between the start of ripple

  • initialPulseScale (default is 0) The initial scale of the pulse

  • numberOfPulses (default is 'float.PositiveInfinity') The number of pulses

License

PulseControl is released under the MIT license.

About

Xamarin iOS Pulsing control

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages