public void IsRewardCollectionEmpty() { var itemsCount = CollectionView.Source.GetItemsCount(CollectionView, 0); if (itemsCount == 0) { EmptyCollectionView.Hidden = false; _swipe = new UISwipeGestureRecognizer(); _swipe.AddTarget(() => HideAreaCollection()); _swipe.Direction = UISwipeGestureRecognizerDirection.Up | UISwipeGestureRecognizerDirection.Down; EmptyCollectionView.AddGestureRecognizer(_swipe); _tap = new UITapGestureRecognizer(); _tap.AddTarget(() => HideAreaCollection()); EmptyCollectionView.AddGestureRecognizer(_tap); var data = NSData.FromFile("Images/panda-ohno.gif"); var image = AnimatedImageView.GetAnimatedImageView(data, ViewForImage); ViewForImage.Image = image.Image; ViewForImage.StartAnimating(); } if (itemsCount != 0) { EmptyCollectionView.Hidden = true; } }
public void StartHUD(string message) { UIViewController controller = UIApplication.SharedApplication.KeyWindow.RootViewController; hud = new MBProgressHUD(controller.View); controller.View.AddSubview(hud); // The sample image is based on the work by http://www.pixelpressicons.com, http://creativecommons.org/licenses/by/2.5/ca/ // Make the customViews 37 by 37 pixels for best results (those are the bounds of the build-in progress indicators) UIImageView gif = AnimatedImageView.GetAnimatedImageView("https://i.stack.imgur.com/naLBK.gif"); hud.CustomView = gif; // Add information to your HUD hud.Label.Text = message; hud.BezelView.Color = UIColor.Clear; hud.BezelView.TintColor = UIColor.Clear; hud.BezelView.Style = MBProgressHUDBackgroundStyle.SolidColor; hud.BezelView.BlurEffectStyle = UIBlurEffectStyle.Dark; // Set custom view mode hud.Mode = MBProgressHUDMode.CustomView; hud.Show(true); }