{ "id": "79550", "key": "TIMOB-5086", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-10-18T12:37:29.000+0000", "created": "2011-08-23T11:49:15.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "dev-invalidate", "ios", "navgroup", "orientation" ], "versions": [ { "id": "11367", "description": "", "name": "Release 1.7.1", "archived": true, "released": true, "releaseDate": "2011-06-21" }, { "id": "13572", "description": "Release 2.1.1", "name": "Release 2.1.1", "archived": true, "released": true, "releaseDate": "2012-07-31" }, { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-23T21:32:57.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h5.Problem\r\nIt seems like Ti can't lock orientation modes in specific windows when targeting the NavigationGroup root window.\r\n\r\nRepro sequence set Root Window as LANDSCAPE, then when a child window is opened (in a navgroup) is not set whether PORTRAIT nor LANDSCAPE modes as specified.\r\n\r\nh5.Tested on\r\nSimulator iOS 4.3 & iPod device \r\n\r\nh5.Repro sequence\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:'gray'\r\n});\r\n \r\nvar open = Ti.UI.createButton({\r\n title:'Open nav group',\r\n top:150,\r\n width:200,\r\n height:40\r\n});\r\nopen.addEventListener('click', function() {\r\n modal.open({modal:true});\r\n});\r\n\r\nwin.add(open);\r\n\r\nvar modal = Ti.UI.createWindow({\r\n //navBarHidden:true,\r\n title:'ModalWin'\r\n});\r\n\r\n\r\n\r\nvar modalWin = Ti.UI.createWindow({\r\n backgroundColor:\"red\"\r\n});\r\n\r\n// initialize to LANDSCAPE MODE\r\nmodal.orientationModes = [\r\n Titanium.UI.LANDSCAPE_LEFT,\r\n Titanium.UI.LANDSCAPE_RIGHT,\r\n]; \r\n\r\n\r\nvar nav = Ti.UI.iPhone.createNavigationGroup({\r\n window:modalWin\r\n});\r\n\r\nvar table = Ti.UI.createTableView({\r\n style:Ti.UI.iPhone.TableViewStyle.GROUPED,\r\n data:[{title:\"Well look at this\"},{title:\"TweetDeck is cool\"}]\r\n});\r\nmodalWin.add(table);\r\n\r\nvar done = Titanium.UI.createButton({\r\n systemButton:Titanium.UI.iPhone.SystemButton.DONE\r\n});\r\n\r\nmodalWin.setRightNavButton(done);\r\n\r\ndone.addEventListener('click',function() \r\n{\r\n modal.close();\r\n});\r\n\r\ntable.addEventListener('click',function(e)\r\n{\r\n var b = Titanium.UI.createButton({\r\n title:'Back (no anim)',\r\n style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED\r\n });\r\n b.addEventListener('click', function() {\r\n nav.close(w,{animated:false});\r\n });\r\n var w = Ti.UI.createWindow({\r\n title:e.rowData.title,\r\n rightNavButton:b\r\n });\r\n \r\n // initialize to portrait modes\r\nw.orientationModes = [\r\n Titanium.UI.PORTRAIT,//Portrait mode is not set either\r\n Titanium.UI.UPSIDE_PORTRAIT,//This window doesn't rotate\r\n]; \r\n\r\n \r\n \r\n w.addEventListener('focus',function()\r\n {\r\n Ti.API.info(\"nav group window -- focus event\");\r\n });\r\n w.addEventListener('blur',function()\r\n {\r\n Ti.API.info(\"nav group window -- blur event\");\r\n });\r\n var b = Ti.UI.createButton({\r\n title:\"Close Nav\",\r\n width:120,\r\n height:40\r\n });\r\n b.addEventListener('click',function()\r\n {\r\n modal.close();\r\n });\r\n w.add(b);\r\n nav.open(w);\r\n});\r\n\r\nmodal.add(nav);\r\nmodal.open();\r\n{code}\r\n\r\nh5.Associated HD ticket\r\n#APP-293437", "attachment": [], "flagged": false, "summary": "iOS: OrientationModes in NavigationGroup windows can't be locked", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK: Mobile 1.7.1\r\nPlatform OS: iOS Version: 4.3 ", "comment": { "comments": [ { "id": "218304", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is because in our current implementation of navigationgroup, it is considered as view and not as view controller. SO it is not considered in the View hierarchy. \r\n \r\nWe might want rethink the implementation of navigation group, for a proper fix to this problem, one that is in no way trivial. ", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-10T17:45:39.000+0000", "updated": "2012-09-10T17:45:39.000+0000" }, { "id": "218482", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The right fix to this problem, would require re-writing the entire navigationGroup for iOS to implement it properly. It can lead to a lot of regressions also. Considering the current time frame, going to move this ticket to be looked at after 3.0 release.\r\n \r\nWhile in the time being, one temporary solution that the user can have is changing the parent windows orientation when entering and exiting different views inside the navigation group.\r\n\r\nModified code implementing this JS Fix :\r\n{code}\r\nvar modal = Ti.UI.createWindow({\r\n    //navBarHidden:true,\r\n    title:'ModalWin'\r\n});\r\n \r\nvar modalWin = Ti.UI.createWindow({\r\n    backgroundColor:\"red\"\r\n});\r\n \r\n// initialize to LANDSCAPE MODE\r\nmodal.orientationModes = [\r\n    Titanium.UI.LANDSCAPE_LEFT,\r\n    Titanium.UI.LANDSCAPE_RIGHT,\r\n]; \r\n \r\n \r\nvar nav = Ti.UI.iPhone.createNavigationGroup({\r\n    window:modalWin\r\n});\r\n \r\nvar table = Ti.UI.createTableView({\r\n    style:Ti.UI.iPhone.TableViewStyle.GROUPED,\r\n    data:[{title:\"Well look at this\"},{title:\"TweetDeck is cool\"}]\r\n});\r\nmodalWin.add(table);\r\n \r\nvar done = Titanium.UI.createButton({\r\n    systemButton:Titanium.UI.iPhone.SystemButton.DONE\r\n});\r\n \r\nmodalWin.setRightNavButton(done);\r\n \r\ndone.addEventListener('click',function() \r\n{\r\n    modal.close();\r\n});\r\n \r\ntable.addEventListener('click',function(e)\r\n{\r\n    var b = Titanium.UI.createButton({\r\n        title:'Back (no anim)',\r\n        style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED\r\n    });\r\n    b.addEventListener('click', function() {\r\n        nav.close(w,{animated:false});\r\n    });\r\n    var w = Ti.UI.createWindow({\r\n        title:e.rowData.title,\r\n        rightNavButton:b\r\n    });\r\n// This will not work.      \r\n//     // initialize to portrait modes\r\n// \tw.orientationModes = [\r\n// \t    Titanium.UI.PORTRAIT,//Portrait mode is not set either\r\n// \t    Titanium.UI.UPSIDE_PORTRAIT,//This window doesn't rotate\r\n// \t]; \r\n//  \r\n     \r\n     \r\n    w.addEventListener('focus',function()\r\n    {\r\n        Ti.API.info(\"nav group window -- focus event\");\r\n\t\tmodal.orientationModes = [\r\n\t    Titanium.UI.PORTRAIT,//Portrait mode is not set either\r\n\t    Titanium.UI.UPSIDE_PORTRAIT,//This window doesn't rotate\r\n\t\t]; \r\n    });\r\n    w.addEventListener('blur',function()\r\n    {\r\n        Ti.API.info(\"nav group window -- blur event\");\r\n\t\tmodal.orientationModes = [\r\n\t\t    Titanium.UI.LANDSCAPE_LEFT,\r\n\t\t    Titanium.UI.LANDSCAPE_RIGHT,\r\n\t\t];\r\n    });\r\n    var b = Ti.UI.createButton({\r\n        title:\"Close Nav\",\r\n        width:120,\r\n        height:40\r\n    });\r\n    b.addEventListener('click',function()\r\n    {\r\n        modal.close();\r\n    });\r\n    w.add(b);\r\n    nav.open(w);\r\n});\r\n \r\nmodal.add(nav);\r\nmodal.open();\r\n{code}", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-11T17:43:18.000+0000", "updated": "2012-09-11T17:43:18.000+0000" }, { "id": "399225", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Nowadays, using the {{Ti.UI.iOS.NavigationWindow}}, the orientation is managed by the contained {{Ti.UI.Window}}.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-18T12:37:29.000+0000", "updated": "2016-10-18T12:37:29.000+0000" }, { "id": "415400", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the previous comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-23T21:32:57.000+0000", "updated": "2017-03-23T21:32:57.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }