SFBusyIndi​​cator没有出现

时间:2017-05-14 13:54:25

标签: c# ios xamarin.ios syncfusion

我正在尝试在Xamarin IOS c#中使用SFBusyIndi​​cator,但它没有出现......

        SFBusyIndicator busyindicator = new SFBusyIndicator();

    public TesourariaViewController(IntPtr handle) : base(handle)
    {
        busyindicator.Frame = this.View.Bounds;
        busyindicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeGear;
        busyindicator.ViewBoxHeight = 200;
        busyindicator.ViewBoxWidth = 200;
        busyindicator.Title = (NSString)"Loading...";
        busyindicator.FontFace = UIFont.SystemFontOfSize(10, UIFontWeight.Thin);
        busyindicator.Center = this.View.Center;
        this.View.Add(busyindicator);

    }

我在ViewDidLoad中有一个按钮触摸事件,我在其中调用busyindicator.IsBusy = true,但没有任何反应,繁忙的指示器没有出现!

猜猜我做错了什么......或者错过了什么...... 谢谢

1 个答案:

答案 0 :(得分:0)

我从未使用过Syncfusion组件,但是从他们getting started page上看到的,组件初始化与你的相比有很大不同:在你的UIVIewController中加入视图有问题。

尝试在ViewDidLoad方法中创建和显示指标(仅用于测试)

public override void ViewDidLoad ()
{
    base.ViewDidLoad ();
    SFBusyIndicator busyindicator = new SFBusyIndicator();
    this.AddSubview(busyindicator);
    busyindicator.AnimationType=SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeBattery;
    busyindicator.TextColor=UIColor.RED;
    busyindicator.ViewBoxHeight=20;
    busyindicator.ViewBoxWidth=20;
    busyindicator.IsBusy=True;
}