Display a file in a view within a window
I want to display the contents of a file within a view from my current window. Does anyone know how to do this? It seems like it should be easy to do but I have not found the answer yet.
var win = Titanium.UI.currentWindow;
var view = Titanium.UI.createView({
url:'showMe.js',
top:20,
width:300,
height:300
});
win.add(view);
1 Answer
-
David
A good example of this is in the KitchenSink in the filesystem.js script, importantly the read() method of the Titanium.Filesystem.File object. In filesystem.js it outputs the contents of the file with the code:
contents.text