Why can't I specify the top of an ImageView within a window?

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

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({
//  url:'main_windows/home.js',
    title:'Sold, Here in Town',
    backgroundColor:'#fff'
});
 
var actionbar = Titanium.UI.createImageView( {
    url: 'images/actionbar/actionbar_bg.png',
    top: '0'
});
 
win1.add( actionbar );
 
win1.open();
That's my code - I know I'm a total noob so any help would be greatly appreciated.

Gratsi!

— asked 2 years ago by Shamoon Siddiqui
1 Comment
  • What error or unexpected behavior are you getting when you run this?

    — commented 2 years ago by Tony Lukasavage

2 Answers

Accepted Answer

The top property should be a number (like 0) instead of a string (like '0') unless you are also adding a suffix like % or dp (e.g. '0dp').

What is the error message you are getting or problem you are having? It also helps to mention the platform and SDK level you are targeting.

Try setting the height and width of the image view equal to the dimensions of images/actionbar/actionbar_bg.png.

Your Answer

Think you can help? Login to answer this question!