improve ui module

This commit is contained in:
hyb1996
2017-05-15 01:12:19 +08:00
parent 6102f6e8fe
commit a8a83dd2b5
9 changed files with 228 additions and 28 deletions

View File

@@ -1,13 +1,20 @@
module.exports = function(__runtime__, scope){
var ui = Object(__runtime__.ui);
ui.layout = function(xml){
view = ui.inflate(activity, xml);
ui.setView(view);
}
ui.setView = function(view){
ui.view = view;
activity.setContentView(view);
}
ui.id = function(id){
return ui.view.getChildAt(0).id(id);
}
return ui;
}