tidev/titanium-sdk

iOS: Incorrect handling of window Vertical layout !

Informate opened this issue · 0 comments

I have searched and made sure there are no existing issues for the issue I am filing

  • I have searched the existing issues

Description

On some iPhone, but NOT ALL and ALWAYS (possibly related to the extendSafeArea=true feature), especially on some old iPhone 8:
If I have a vertical layout set directly to the main window object (not at creation time), the views do not shows correctly.
I found that an intermediate view is added to the stack, but the layout property is not correctly inherited.

// FIXING WORKAROUND
setTimeout(()=>{if (win.children.length===1) win.children[0].layout='vertical';},500);

Maybe also setting at creation time the layout property could work, but not tested at the moment.

Expected Behavior

The window layout is vertical

Actual behavior

An intermediate view is added but the layout is not inherited!

Reproducible sample

Pseudo Code:

win = Ti.UI.createWindow({extendSafeArea: true, fullscreen:false, navBarHidden: true});
win.layout='vertical';
win.add(Ti.UI.createView(...));
win.add(Ti.UI.createScroll({height: Ti.UI.FILL}));
// FIX
setTimeout(()=>{if (win.children.length===1) win.children[0].layout='vertical';},500);

Steps to reproduce

run many times the app on "some" (old?) iPhone.

Platform

iOS

SDK version you are using

12.1.2.GA

Alloy version you are using

No response