[AC-1881] iOS: Modal Window, wrong layout
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2013-04-18T17:37:35.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | ios, layout, modal, navigationgroup |
Reporter | Martin Guillon |
Assignee | Mauro Parra-Miranda |
Created | 2013-04-16T13:16:46.000+0000 |
Updated | 2016-03-08T07:40:48.000+0000 |
Description
*Steps to reproduce*
If you run the test case you can see too things:
- open close multiple times the modal window. You get wrong layout 1 / 2
- NavigationGroup: wrong layout adjustment on opening
*Test case*
// by default the modal window has a nav bar
// since we're embedding a navgroup inside the modal
// window which also has a nav bar, we ask him to hide it
var currentwin = Ti.UI.createWindow({
backgroundColor : "white"
});
var open = Ti.UI.createButton({
title : 'Open nav group',
top : 150,
width : 200,
height : 40
});
open.addEventListener('click', function() {
modal.open({
modal : true
});
});
currentwin.add(open);
var modal = Ti.UI.createWindow({
backgroundColor : 'black',
navBarHidden : true
});
var modalWin = Ti.UI.createWindow({
backgroundColor : "red"
});
var nav = Ti.UI.iPhone.createNavigationGroup({
top : 0,
bottom : 0,
window : modalWin,
backgroundColor : 'blue'
});
var table = Ti.UI.createTableView({
top : 10,
style : Ti.UI.iPhone.TableViewStyle.GROUPED,
data : [{
title : "Well look at this"
}, {
title : "TweetDeck is cool"
}]
});
modalWin.add(table);
modalWin.add(Ti.UI.createView({
bottom : 5,
width : 100,
height : 100,
backgroundColor : 'blue'
}));
var done = Titanium.UI.createButton({
systemButton : Titanium.UI.iPhone.SystemButton.DONE
});
modalWin.setRightNavButton(done);
done.addEventListener('click', function() {
modal.close();
});
table.addEventListener('click', function(e) {
var b = Titanium.UI.createButton({
title : 'Back (no anim)',
style : Titanium.UI.iPhone.SystemButtonStyle.BORDERED
});
b.addEventListener('click', function() {
nav.close(w, {
animated : false
});
});
var w = Ti.UI.createWindow({
title : e.rowData.title,
rightNavButton : b
});
w.addEventListener('focus', function() {
Ti.API.info("nav group window -- focus event");
});
w.addEventListener('blur', function() {
Ti.API.info("nav group window -- blur event");
});
var b = Ti.UI.createButton({
title : "Close Nav",
width : 120,
height : 40
});
b.addEventListener('click', function() {
modal.close();
});
w.add(b);
nav.open(w);
});
modal.add(nav);
// modal.open({modal:true});
currentwin.open();
Attachments
File | Date | Size |
---|---|---|
31ga-modalwindow.png | 2013-04-17T23:50:01.000+0000 | 16280 |
pull request https://github.com/appcelerator/titanium_mobile/pull/4170
Hi Martin, Please can you clarify what you mean by "wrong layout"? The fact that the red background shows, meaning the height of the modal view is not correct? Thanks.
@Daniel: I am really confused, i cant reproduce it either on the master branch or even on 3.0.2.GA I was sure it was happening. This is really strange to me You can close it for now and i ll try and dig deep into this. I am really really sorry to have wasted your time Daniel.
No problem, I'll resolve as "Cannot Reproduce".