When the "in-call status" bar is showing, new windows and then the root window change their top position incorrectly.
Try this test which opens subsequent windows in a NavigationWindow (with random colors).
In the simulator, open some windows, then in the simulator menu, go to Hardware > Toggle In-Call Status Bar.
The window moves down, as expected at first. Now open some more windows, and you should see the windows showing incorrectly, despite being set at fullscreen:false
Now go back to the root window and see that it's wrong too.
If your app can re-orientate in tiapp.xml, it seems to reset after being upside down.
Also try turning the bar off and on again.
/*
Fun with NavigationWindow!
creates random coloured windows which create buttons which create random coloured windows which create buttons which...
you get the picture ;)
Required : Titanium SDK 3.1.3 or higher.
Kosso
*/
function randomColor(){
return '#'+(function lol(m,s,c){return s[m.floor(m.random() * s.length)] + (c && lol(m,s,c-1));})(Math,'0123456789ABCDEF',4);
}
// Works with Release 3.1.3 and later
var rootWin = Ti.UI.createWindow({
backgroundColor:randomColor(),
fullscreen:false,
barColor:randomColor(),
navTintColor:randomColor(),
translucent:false
});
var b1 = Ti.UI.createButton(
{
title:'NEW',
borderColor:'black',
borderWidth:2,
width:200,
height:60,
borderRadius:30,
tintColor:'red',
backgroundColor:'white'
});
b1.addEventListener('click',function(){
navWin.openWindow(buildNewWindow({
backgroundColor:randomColor(),
fullscreen:false,
barColor:randomColor(),
navTintColor:randomColor(),
translucent:true
}));
});
rootWin.add(b1);
var navWin = Ti.UI.iOS.createNavigationWindow({window:rootWin});
function buildNewWindow(args){
var _self = Ti.UI.createWindow(args);
var btn_new = Ti.UI.createButton(
{
title:'NEW',
top:20,
borderColor:'black',
borderWidth:2,
width:200,
height:60,
borderRadius:30,
tintColor:'red',
backgroundColor:'white'
});
_self.add(btn_new);
btn_new.addEventListener('click', function(){
navWin.openWindow(buildNewWindow({
backgroundColor:randomColor(),
fullscreen:false,
barColor:randomColor(),
navTintColor:randomColor(),
translucent:true
}
)
);
});
var btn_back = Ti.UI.createButton(
{
title:'< BACK',
bottom:40,
borderColor:'white',
borderWidth:2,
width:200,
height:60,
borderRadius:30,
tintColor:'white',
backgroundColor:'#333'
});
_self.add(btn_back);
btn_back.addEventListener('click', function(){
navWin.closeWindow(_self);
});
return _self;
}
navWin.open();
I think this should be marked as urgent. Many of my testers use their devices as hotspots and are having to deal with this issue. It seems to reset if the device is re-oriented.
[~kosso] We'll investigate. All--is there a reason no severity was attached?
No reason other than I missed the option to set one. This is urgent for me and my apps. I'm still waiting for a fix. I see it's now set to 'High' severity.
Here's also a simpler test which shows that something VERY wrong is going on with the positioning of the root window/navWindow/(also tabGroup behaves the same) when the device is re-oriented (as well as when opening windows) WHEN the In-Call status bar is showing. Be sure to allow for orientation changes in the tiapp.xml Simply run this app.js code, activate the In-Call status bar and turn your device upside down and back upright again. app.js
Any idea when this is going to be resolved. It's pretty serious imho, since every iOS7 app will be affected by the broken window positioning when the In-call status bar is showing. I've had people waiting for an update for a couple weeks now - which does't look good for anyone. Sorry for urgency, but it seems pretty crucial to everyone.
Is this going to get fixed for 3.1.3 at all? I really do NOT want to have to wait for 3.2.0 to have this fixed. Surely it's an 'easy' fix? It seems like something simple has not been taken into account when adjusting the window frame. I'm now one month late with an app update for iOS7 due to this serious bug.
[~kosso] We don't plan on having another official 3.1.X release, but if we fix this in the CI builds of 3.1.X, would you be able to grab the fix from there?
Absolutely! :) And 'Yes Please!'
We can only reproduce this on upside down mode. Tested with native app and reproduced the same issue. This seems to be an Apple bug. Marking as not our bug.
If you use either of the test codes above, with the phone the right way up and open and close new windows with the in-call status bar showing, our new window is incorrectly placed. Turning it upside down and back again seems to be the only way to fix it (until the next window is opened). Be sure to also try this with the in-call bar showing then close the app completely and re-open it. Also, the second test code will show that when the in-call status is toggled on, our app window is hidden behind it, instead of being pushed down, as it should. As you say, you might see it OK and not the right way up, but try this : While showing the bar on the device (ie: turn your hotspot on if you can) go and close the app totally and re-open it. You will see the our app window behind the hotspot status bar. Again, inverting the device and back again will fix it. Which version/branch/hash Titanium SDK are you testing this against? Since the Ti CLI 3.2.0 does not yet correctly work with detecting the Android SDKs (bug filed), I can't possibly use Titanium 3.2.0 yet.
[~kosso] I think the suggestion was that it may be a bug, but that the bug was reproducible identically in a native application, so it's an Apple bug we can't do much about until they fix it.
Which 'native apps' were tested? I've just tried most of Apple's own apps with the status bar showing and all work
fineas expected (try ones which allow for full-reorientation eg: iMovie) You can see the top of the window re-adjust itself in the 'native' apps I tried. Our implementation is quite simply, broken. I'd say it's 'our' bug : imho.[~penrique] Can you post the native application we used to test so [~kosso] can try for himself? [~kosso], what's an example native app you used?
I tried: Mail (allows portrait and landscape) Maps (allows portrait and landscape) Contacts (allows portrait and landscape) iMovie (allows all orientations) iTunes (portrait only) Facebook. + others which are portrait only. .. all work as expected. Also, if you try the first test case app.js but edit tiapp.xml to ONLY allow Ti.UI.PORTRAIT you will find the app open with the window placed incorrectly and n amount of re-orientation will fix it.
Kosso, we could only reproduce this on upside down orientation. I have a attached the native simple app I created which shows what we think is an apple bug. Can you upload you simple Titanium project? (without the build folder). I want to make sure we're testing the same exact thing.
The code I'm testing is the same Test Case app.js code at the top of this bug report. Just use that with a fresh app project. It might be worth testing if it's different with a TabGroup too, as opposed to my test code which uses the new NavigationWindow.
Try this test app project : https://dl.dropboxusercontent.com/u/60353877/testing.zip
btw: I have noticed that the behaviour changes depending on the setting of 'UIViewControllerBasedStatusBarAppearance' which I have needed to use in tiapp.xml for on e of my apps.
It seems to have less issues (and more like how you described it, in that the bug appears only when upside down) when this is set to true.
[~kosso] Is there a reason you have to set it to false?
To try and deal with this issue. It seems to mitigate the original issue down to only occurring when upside down.
Wait--so you have _less_ issues when you set it to _false_ or to _true_? From above it sounded as if there were less issues for you when it was set to true.
When set to false (or omitted), the issues are worse and happen when the device is upright. If the hotspot/in-call bar is showing: When false: - the navbar is not positioned correctly on launch - it requires turning upside down and back again. - the navbar then slips up again when opening a new window from a TabGroup OR a NavigationWindow (tested both) When set to true: - The navbar positioning only fails when upside down (as Pedro found) - and corrects itself when put upright again. BUT.. when this is set to true I can't get the LIGHT_CONTENT status bar to work correctly - ie: show white text on dark background.
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/4976
Merged into master!
This is such good news. Which SDK version can I now find this in? The latest master 3.2.0 CI? Or will it get rolled into 3.1.x?
3.2.0 CI. Should be available later today
Thanks Vishal. Much appreciated. Hopefully Studio and CLI will play nicely too. ;)
Verified fixed on: Mac OSX 10.9 Mavericks Titanium Studio, build: 3.2.0.201311262027 Titanium SDK, build: 3.2.0.v20131127114913 CLI: 3.2.0-beta Alloy: 3.2.0-beta iOS Simulator: 7.0.3 Application window moves correctly when in-call. Closing
still happening ... not closed !
ok it was because of:
This appears to have returned since updating to Appcelerator Studio and SDK 4.0.0.GA Try the same test code above and the window is incorrectly placed when the hotspot area is visible, *after* turning the device upside down and back again. !https://mobods.com/test/hotspot_bug.png|width=400!
This also happens on the simulator. Use the menu Hardware > Toggle In-call Status bar to test. Making sure to add the required orientation ability in tiapp.xml Rotating the device causes the window to _slip_ up.