在Xamarin iOS中的UIActivityIndi​​catorView中隐藏指示器

时间:2018-09-06 11:14:58

标签: ios xamarin

如何禁用或隐藏UIActivityIndi​​catorView中的指标?

public class ActivityView : UIActivityIndicatorView {

    public ActivityView (CGRect frame) : base (frame){

    }
    public bool IsLoading {
        get {
            return !this.Hidden;
        }
        set {
            if (value) {
                this.Hidden = false;
                this.StartAnimating ();
            } else {
                this.StopAnimating ();
            }
        }
    }
}

1 个答案:

答案 0 :(得分:0)

只需添加:

    this.TintColor = UIColor.Clear;
    this.Color = UIColor.Clear;

在此部分:

if (value) {
    ...
    this.TintColor = UIColor.Clear;
    this.Color = UIColor.Clear;
}