{"action":"closed","issue":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/1281","labels_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/1281/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/1281/comments","events_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/1281/events","html_url":"https://github.com/NativeScript/NativeScript/issues/1281","id":123288080,"number":1281,"title":"Native properties are reset on orientation change","user":{"login":"speigg","id":507127,"avatar_url":"https://avatars.githubusercontent.com/u/507127?v=3","gravatar_id":"","url":"https://api.github.com/users/speigg","html_url":"https://github.com/speigg","followers_url":"https://api.github.com/users/speigg/followers","following_url":"https://api.github.com/users/speigg/following{/other_user}","gists_url":"https://api.github.com/users/speigg/gists{/gist_id}","starred_url":"https://api.github.com/users/speigg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/speigg/subscriptions","organizations_url":"https://api.github.com/users/speigg/orgs","repos_url":"https://api.github.com/users/speigg/repos","events_url":"https://api.github.com/users/speigg/events{/privacy}","received_events_url":"https://api.github.com/users/speigg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-21T14:24:01Z","updated_at":"2015-12-22T14:59:22Z","closed_at":"2015-12-22T14:59:22Z","body":"I'm doing this when the page loads:\r\n\r\n```typescript\r\nfunction makePageTransparentIOS(page:pages.Page) {\r\n\tconst pageView:UIViewController = page.ios;\r\n\tpageView.view.opaque = false;\r\n\tpageView.view.backgroundColor = UIColor.clearColor();\r\n}\r\n\r\nexport function pageLoaded(args) {\r\n    var page:pages.Page = args.object;\r\n\tif (page.ios) {\r\n\t\tmakePageTransparentIOS(page)\r\n\t}\r\n}\r\n```\r\n\r\nI tried using css, but apparently there isn't support for `rgba` values for `background-color` yet (opacity works, but I don't want to make the entire view + child views transparent, just it's background).\r\n\r\nThe problem is that the view's native properties (`opaque` and `backgroundColor`) are apparently being reset whenever the device orientation changes. I tried listening to the `orientationChange` event via the `application` api, but the native properties were still being reset after the orientation change. The workaround I finally worked out involves wrapping the `layout` function:\r\n\r\n```typescript\r\nexport function pageLoaded(args) {\r\n    var page:pages.Page = args.object;\r\n\tif (page.ios) {\r\n\t\tmakePageTransparentIOS(page)\r\n\t\tconst origLayout = page.layout;\r\n\t\tpage.layout = function(...args) {\r\n\t\t\torigLayout.apply(page, args);\r\n\t\t\tmakePageTransparentIOS(page);\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\nIs this the intended workflow, or is there a bug?"}}