2014-11-21 20 views
1

如何在XML視圖中使用自定義控件?在XML視圖中使用自定義控件

我有一個名爲foo.bar.MyControl的控件,它擴展了sap.m.Button

我想使用控制在我的XML視圖:

<core:View controllerName="foo.bar.controller.Root" 
      xmlns:commons="sap.ui.commons" 
      ...> 

    <!-- what to type here ??? --> 

</core:View> 

回答

4

請嘗試以下

<core:View controllerName="foo.bar.controller.Root" 
      xmlns:foobar="foo.bar" 
      ...> 
    <foobar:MyControl> 
    </foobar:MyControl> 
</core:View> 

命名空間反映JavaScript的命名空間和MyControl是構造函數。

最好的問候, Tobias

相關問題