createView problems!
I have a problem with my view. this is my code:
var barV = Titanium.UI.createView({
borderRadius:0,
backgroundImage:'images/bar.png',
width:Titanium.Platform.displayCaps.platformHeight,
height:44,
top:0
});
mainW.add(barV);
In this view i try to create a button:
var topB = Ti.UI.createButton({
width:23, height:24,
top:10, right:10,
backgroundImage:'images/topB.png',
color:'#FFFFFF'
});
barV.add(topB);
But i want the view to have the width of the screen, so thats its full in both portrait and landscape. But when i just set width to the platform.Height the button ain't placing correct. How can i set it to scale the background, so the button allways stays in the right side, 10 px away from the side?
Please tell me if it's not understandable.
2 Answers
-
What do you want to position 10px from the right? the button? or the background?
If the button try this:
barV.width = '100%'
-
sorry nvm.