[TIMOB-5808] Android: Unexpected "Ghost-Margin" in a Vertical layout!
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-01-31T15:51:19.000+0000 |
Affected Version/s | Release 1.7.3 |
Fix Version/s | Sprint 2011-50, Release 2.0.0, Release 1.8.1 |
Components | Android |
Labels | module_window, parity, qe-testadded |
Reporter | Andreas |
Assignee | Hieu Pham |
Created | 2011-08-26T11:48:55.000+0000 |
Updated | 2012-03-03T22:30:09.000+0000 |
Description
I try to create an article with some paragraphs (see example sourcecode: uiLabelRed, uiLabelBlue and uiLabelGreen). I use vertical layout! Each paragraph should have 10dp space (by adding top:'10dp', see example and screenshot)
On the appended screenshot you see the strange result. I already tried to find a workaround (encapsulate the labels), but this also dont work. See forum. http://developer.appcelerator.com/question/124783/unwanted-ghost-padding-in-a-vertical-layout#answer-217498
var uiWindow = Ti.UI.createWindow({
navBarHidden: true
});
var uiViewBackground = Ti.UI.createView({
layout: 'vertical',
backgroundColor: '#FFFFFF'
});
var uiViewArticle = Ti.UI.createView({
layout: 'vertical',
backgroundColor: '#aabbcc'
});
// add intro red
var uiLabelRed = Ti.UI.createLabel({
text: 'I´m the RED bar (10dp top)!',
backgroundColor: '#AA0000',
width: '100%',
height: 'auto',
top: '10dp'
});
// add intro red
var uiLabelGreen = Ti.UI.createLabel({
text: 'I´m the GREEN bar (10dp top)!',
backgroundColor: '#00AA00',
width: '100%',
height: 'auto',
top: '10dp'
});
// add intro red
var uiLabelBlue = Ti.UI.createLabel({
text: 'I´m the BLUE bar (10dp top)!',
backgroundColor: '#0000AA',
width: '100%',
top: '10dp'
});
// add all 3 labels with 10dp (7 pixel) top
uiViewArticle.add(uiLabelRed);
uiViewArticle.add(uiLabelGreen);
uiViewArticle.add(uiLabelBlue);
// after adding the tree labels, the background
// view got 30dp (21 pixel) extra at the bottom!
uiViewBackground.add(uiViewArticle);
uiWindow.add(uiViewBackground);
uiWindow.open();
Attachments
File | Date | Size |
---|---|---|
titanium_bottom_bug.gif | 2011-08-26T11:48:55.000+0000 | 4823 |
Closing bug. Verified fix on: SDK build: 1.9.0.v20120112153134 Runtime: V8, Rhino Titanium Studio, build: 1.0.8.201201122152 Device: Droid 3 (2.3.4) Note: Bug was reproducible in 1.7.5 and 1.8.0.1
Editing comment