imageView size

You must Login before you can answer or comment on any questions.

I'm trying to place and imageView and a tableView in the same window. Currently the two views keep overlapping. How can I stack them so that the imageView is at the top of the window and the tableView starts after the end of the imageView? Thanks. Max

1 Answer

Accepted Answer

Try th following:

var img = Ti.UI.createImageview({
url:'img1.png',
height:20,//height of image
width:20,//width of image
top:0
});
Ti.UI.currentWindow.add(img);
var table = Ti.UI.createTableview();
table.top = img.top+img.height;
Ti.UI.currentWindow.add(table);
This willl work.

— answered 11 months ago by Ashutosh Chaturvedi
answer permalink
5 Comments
  • Thank you Chaturvedi for your the help.

    The problem with this approach is that the image stays fixed in one position; it does not scroll up with table so that more information can be seen on the screen.

    — commented 11 months ago by Conelrad Max

  • you can not put a tableview in a scrollview so if u need image should also scroll with table then add the image with first row of the table.

    — commented 11 months ago by Ashutosh Chaturvedi

  • Can I use an imageView as a table header?

    — commented 11 months ago by Conelrad Max

  • Show 2 more comments

Your Answer

Think you can help? Login to answer this question!