試圖建立一些簡單的應用程序與rikulo框架,有一個問題:如何找到與查看ID
是否有可能找到
View
分層佈局裏面?如何 ? (在Dart中)Rikulo網站上有一些關於IdSpace的文檔,但我不太明白如何使用它。 I延伸
View
與IdSpace
?或者View
會自動生成Id?
更新(添加的代碼示例)
/*
* Function will actualy build View
*/
void _buildUi(Element tagElement)
{
View mainView = new View();
mainView.profile.width = '100%';
mainView.profile.height = '100%';
mainView.layout.type = 'linear';
mainView.layout.orient = 'vertical';
mainView.style.cssText = "background: yellow;";
View vWorkSpace = new View();
vWorkSpace.profile.width = 'flex';
vWorkSpace.profile.height = 'flex';
vWorkSpace.layout.type = 'linear';
vWorkSpace.layout.orient = 'horizontal';
vWorkSpace.style.cssText = "background: red;";
//
// Left menu
View vLeftBar = new View();
vLeftBar.profile.width = "10%";
vLeftBar.profile.height = "10%";
vLeftBar.layout.type = 'linear';
vLeftBar.layout.orient = 'vertical';
vLeftBar.layout.spacing = '10';
View vLogo = new View();
vLogo.addChild(new Image('images/google_chrome.png'));
vLeftBar.addChild(vLogo);
Button vButton = new Button();
vButton.text = 'Sign in with Google';
vLeftBar.addChild(vButton);
vButton.on.click.add((e){ // Somehow I get an error here: Method 'add' not defined for class 'Stream'
broadcaster.send(new ViewEvent('foo'));
});
vWorkSpace.addChild(vLeftBar);
mainView.addChild(vWorkSpace);
mainView.addToDocument(ref: tagElement, layout: true);
}
在dart.app另一個地方處理vButton
click事件時。我如何找到(在代碼中)vLogo
視圖?
任何代碼示例都不錯 – Jasper 2013-04-24 06:24:06
有關[IDSpace](http://docs.rikulo.org/ui/latest/Views/Fundamentals/ID_Space_and_Query.html)的更多信息。 – simonpai 2013-04-25 01:57:58