C# Class Restaurant.iOS.Controls.BadgeBarButtonItem

Inheritance: UIBarButtonItem
Show file Open project: Jurabek/Restaurant Class Usage Examples

Public Methods

Method Description
BadgeBarButtonItem ( ) : System
BadgeBarButtonItem ( UIButton customButton ) : System
RefreshBadge ( ) : void

Change new attributes

RemoveBadge ( ) : void
UpdateBadgeValueAnimated ( bool animated ) : void

Private Methods

Method Description
DuplicateLabel ( UILabel labelToCopy ) : UILabel
InitializeValues ( ) : void
UpdateBadgeFrame ( ) : void

When the value changes the badge could need to get bigger Calculate expected size to fit new value Use an intermediate label to get expected size thanks to sizeToFit We don't call sizeToFit on the true label to avoid bad display

Method Details

BadgeBarButtonItem() public method

public BadgeBarButtonItem ( ) : System
return System

BadgeBarButtonItem() public method

public BadgeBarButtonItem ( UIButton customButton ) : System
customButton UIButton
return System

RefreshBadge() public method

Change new attributes
public RefreshBadge ( ) : void
return void

RemoveBadge() public method

public RemoveBadge ( ) : void
return void

UpdateBadgeValueAnimated() public method

public UpdateBadgeValueAnimated ( bool animated ) : void
animated bool
return void