From f8f75ff61236bcf9dc6d58e54f6f33276dc5f10c Mon Sep 17 00:00:00 2001 From: Yamill Vallecillo Date: Thu, 10 Sep 2015 13:53:23 -0700 Subject: [PATCH] Navigator.NavigationBar Landscape Fix Summary: NavigationBar items are fixed to Portrait when Device is in Landscape. This supplements that fix by removing the `width` properties and just using `left` and `right` positioning respectively. Before: ![ios simulator screen shot sep 8 2015 1 27 02 pm](https://cloud.githubusercontent.com/assets/755943/9743817/3e6b858a-5636-11e5-80e8-81e62b46c46e.png) After: ![ios simulator screen shot sep 8 2015 1 29 21 pm](https://cloud.githubusercontent.com/assets/755943/9743822/43e7d4b4-5636-11e5-8e1c-9f13bdc492b2.png) Closes https://github.com/facebook/react-native/pull/2606 Reviewed By: @vjeux Differential Revision: D2426942 Pulled By: @ericvicenti --- .../Navigator/NavigatorNavigationBarStyles.ios.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Libraries/CustomComponents/Navigator/NavigatorNavigationBarStyles.ios.js b/Libraries/CustomComponents/Navigator/NavigatorNavigationBarStyles.ios.js index 769722a64..53ec69a4b 100644 --- a/Libraries/CustomComponents/Navigator/NavigatorNavigationBarStyles.ios.js +++ b/Libraries/CustomComponents/Navigator/NavigatorNavigationBarStyles.ios.js @@ -41,8 +41,8 @@ var BASE_STYLES = { position: 'absolute', top: STATUS_BAR_HEIGHT, left: 0, + right: 0, alignItems: 'center', - width: SCREEN_WIDTH, height: NAV_BAR_HEIGHT, backgroundColor: 'transparent', }, @@ -52,18 +52,16 @@ var BASE_STYLES = { left: 0, overflow: 'hidden', opacity: 1, - width: SCREEN_WIDTH / 3, height: NAV_BAR_HEIGHT, backgroundColor: 'transparent', }, RightButton: { position: 'absolute', top: STATUS_BAR_HEIGHT, - left: 2 * SCREEN_WIDTH / 3, + right: 0, overflow: 'hidden', opacity: 1, alignItems: 'flex-end', - width: SCREEN_WIDTH / 3, height: NAV_BAR_HEIGHT, backgroundColor: 'transparent', },