2017-08-02 88 views
0

如何在自定義UI5應用程序中使用自定義.gif文件預加載器。點擊彈出或導航延遲按鈕時。SAPUI5中的自定義Gif加載器

下面是我的代碼

<content> 
     <Button 
      text="Dialog" 
      width="230px" 
      press="onDialogPress" 
      class="sapUiSmallMarginBottom" /> 
    </content> 

onDialogPress: function(oEvent) { 

    var that = this; 
    if (!that.pressDialog) { 
     that.pressDialog = new sap.m.BusyDialog({ 
      text: 'Loading...', 
     }); 

     //to get access to the global model 
     this.getView().addDependent(that.pressDialog); 
    } 

    that.pressDialog.open(); 
}, 

回答

1

BusyDialog具有添加自定義圖片的選項:

onDialogPress: function(oEvent) { 
    if (!this.pressDialog) { 
     this.pressDialog = new sap.m.BusyDialog({ 
      text: 'Loading...', 
      customIcon: './stackoverflow/loading.gif', 
      customIconRotationSpeed: 0, 
      customIconWidth: '48px', 
      customIconHeight: '48px' 
     }); 
     this.getView().addDependent(that.pressDialog); 
    } 
    this.pressDialog.open(); 
} 

結果:
enter image description here

+0

它工作得很好:)謝謝拉胡爾 – Archana