Title: Support status bar styles without action bar on iOS · Issue #7153 · NativeScript/NativeScript · GitHub
Open Graph Title: Support status bar styles without action bar on iOS · Issue #7153 · NativeScript/NativeScript
X Title: Support status bar styles without action bar on iOS · Issue #7153 · NativeScript/NativeScript
Description: Is your feature request related to a problem? Please describe. Currently, the status bar style is only applied while the action bar is visible. If (in a non-action bar page) the background of the page requires the status bar text to be w...
Open Graph Description: Is your feature request related to a problem? Please describe. Currently, the status bar style is only applied while the action bar is visible. If (in a non-action bar page) the background of the p...
X Description: Is your feature request related to a problem? Please describe. Currently, the status bar style is only applied while the action bar is visible. If (in a non-action bar page) the background of the p...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/7153
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support status bar styles without action bar on iOS","articleBody":"**Is your feature request related to a problem? Please describe.**\r\nCurrently, the status bar style is only applied while the action bar is visible. If (in a non-action bar page) the background of the page requires the status bar text to be white on both iOS and Android, the developer must make the action bar transparent, resulting in platform specific code, since this works on Android.\r\n\r\n**Describe the solution you'd like**\r\nThe `Page` component respects the `statusBarStyle` property even if the action bar is hidden.\r\n\r\n**Describe alternatives you've considered**\r\nNone.\r\n\r\n**Additional context**\r\nThe simple solution is to implement a getter for the [preferredStatusBarStyle](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621416-preferredstatusbarstyle) computed property on `UIViewController` in `page.ios.js`:\r\n```\r\nObject.defineProperty(UIViewControllerImpl.prototype, \"preferredStatusBarStyle\", {\r\n get: function () {\r\n var owner = this._owner.get();\r\n if(owner) {\r\n // Assuming the statusBarStyle is of type 'string'\r\n return owner.statusBarStyle === \"dark\" ? 1 : 0;\r\n }\r\n // No owner - default to standard\r\n return 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n});\r\n```\r\n\r\n\u003cbountysource-plugin\u003e\r\n\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/72916286-support-status-bar-styles-without-action-bar-on-ios?utm_campaign=plugin\u0026utm_content=tracker%2F12908224\u0026utm_medium=issues\u0026utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin\u0026utm_content=tracker%2F12908224\u0026utm_medium=issues\u0026utm_source=github).\r\n\u003c/bountysource-plugin\u003e","author":{"url":"https://github.com/Frederiks96","@type":"Person","name":"Frederiks96"},"datePublished":"2019-04-16T10:36:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/7153/NativeScript/issues/7153"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:64a87521-009a-966b-b8b8-376019e871ed |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E756:2D3E98:11D4EE6:1712D8C:697438D5 |
| html-safe-nonce | f5c9d906eabefc6e2aeab23fd6f4156aa3716355b62ababf150676d51adbe700 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzU2OjJEM0U5ODoxMUQ0RUU2OjE3MTJEOEM6Njk3NDM4RDUiLCJ2aXNpdG9yX2lkIjoiNzUwMzY5Nzc2MDcxNzM4Nzk4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 17701530e2c843f2d949a4b765ddd22ebe6720635decec6c36e34d93191dbd4b |
| hovercard-subject-tag | issue:433707619 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/NativeScript/7153/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fce089c59907ed71f075c49ba474cc9c98c871fdc33d00ce997fad955463479e/NativeScript/NativeScript/issues/7153 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fce089c59907ed71f075c49ba474cc9c98c871fdc33d00ce997fad955463479e/NativeScript/NativeScript/issues/7153 |
| og:image:alt | Is your feature request related to a problem? Please describe. Currently, the status bar style is only applied while the action bar is visible. If (in a non-action bar page) the background of the p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Frederiks96 |
| hostname | github.com |
| expected-hostname | github.com |
| None | e0b95d743b7672c9ac0e1032d5f117950182dc164a83434a7db86510e8f0b37c |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fe7e2e8de6e57740bca50402351ea656f7a4bf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width