Reputation: 5416
I have a tableViewRow with a view inside it.
Trying to set the view to the platormWidth - 20, with a left of 10, so it's centered.
This works fine on iOS but not android (see green rectange in photo below):
Why?
var innerView = Ti.UI.createView({
width: Ti.Platform.displayCaps.platformWidth - 20,
height: 20,
backgroundColor: 'green',
left: 10,
top: 10,
layout: 'horizontal'
});
Thanks.
Upvotes: 0
Views: 163
Reputation: 6095
The default is to have the view centered, so just do this:
var innerView = Ti.UI.createView({
width: Ti.Platform.displayCaps.platformWidth - 20,
height: 20,
backgroundColor: 'green'
});
Upvotes: 0
Reputation: 2668
var innerView = Ti.UI.createView({
height: 20,
backgroundColor: 'green',
left: 10,
right:10,
top: 10,
// layout: 'horizontal'
});
Upvotes: 1