[TIMOB-16367] Android: Nested layout issue with Android
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-08-15T18:00:21.000+0000 |
Affected Version/s | Release 3.2.0 |
Fix Version/s | n/a |
Components | Android |
Labels | android, layout, nested, parity, views |
Reporter | Paul Hamilton |
Assignee | Eric Merriman |
Created | 2014-02-03T18:16:25.000+0000 |
Updated | 2017-08-15T18:00:21.000+0000 |
Description
When a vertical layout is nested within a horizontal layout on an android device. The views don't work properly. The height of the vertical view is added to the horizontal view, and the vertical view is not centered in the horizontal view as it should be (with no top property set) works correctly in iphone, see the iphone result for what i expect should be occurring.
Notice on android the blue extending past the image (the added height, seemingly equal to the height of the red) and the vertical layout view docked to the top of the horizontal view, should be centered
With dynamic data coming in, i'm not sure of a workaround.
Alloy:
xml:
<Alloy>
<Window class="container">
<View class="horizontal">
<ImageView></ImageView>
<View class="vertical">
<Label id="label1"></Label>
<Label id="label2"></Label>
</View>
</View>
</Window>
</Alloy>
tss:
"ImageView":{
image: "/appicon.png",
height: 64,
width: 64
}
".horizontal": {
layout: "horizontal",
width: Ti.UI.FILL,
height: Ti.UI.SIZE,
backgroundColor: "blue"
}
".vertical": {
layout: "vertical",
width: Ti.UI.FILL,
height: Ti.UI.SIZE,
backgroundColor: "red"
}
"Label":{
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
}
"#label1": {
text: "Label 1 text",
color: "black"
}
"#label2": {
text: "Label 2 text",
color: "black"
}
Attachments
File | Date | Size |
---|---|---|
Screenshot-Android.png | 2017-08-15T17:59:13.000+0000 | 46392 |
Screenshot-iOS.png | 2017-08-15T17:59:13.000+0000 | 52152 |
Moving this ticket to engineering as I can reproduce this issue on Android platform. It works as expected on iOS platform so it is a parity issue.
still in 3.3 This but is killing my android design. Any chance for an update?
So glad someone already posted this bug. Thought, I was the only one(TC-4691) having this issue. Thought I could use
Not a bug. This is working as expected. The horiztonal view will be set to the height based on the tallest child view (in this case, the image). I've also verified that the vertical view is correctly centered vertically within the horizontal view. Attached screenshots showing it working correctly on both Android and iOS.
JSON Source