Skip to content

Instantly share code, notes, and snippets.

@iskugor
Created February 28, 2012 22:28
Show Gist options
  • Save iskugor/1935710 to your computer and use it in GitHub Desktop.
Save iskugor/1935710 to your computer and use it in GitHub Desktop.
Titanium "horizontal" layout bug on iOS
//tested with 1.8.1
//it seems that problem exists when button's dimension values are defined using percentages
var win = Ti.UI.createWindow({
backgroundColor: '#333'
});
var view = Ti.UI.createView({
backgroundColor: '#93f',
height: '20%',
layout: 'horizontal'
});
var button1 = Ti.UI.createButton({
title: 'Button 1',
height: '80%',
width: '30%'
});
var button2 = Ti.UI.createButton({
title: 'Button 2',
height: '80%',
width: '30%'
});
view.add(button1);
view.add(button2);
win.add(view);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment