Comments (26)
This is totally the right place, please keep the issues coming :)
We haven't had the need for changing UIStatusBarStyleLightContent yet so we haven't figured out a solution for it (you'll keep this same statement a lot :p). I would love to get your opinion in what would be the best way to expose it to React / JS.
from react-native.
Perhaps we could have a root level component called <Application>
or similar that has props like statusBarStyle. That way we can update that prop from within our app if we need to change the style while the app is running
from react-native.
@nick For now you could set View controller-based status bar appearance
to NO in your Info.plist and then add the following to your AppDelegate's application:didFinishLaunchingWithOptions:launchOptions
method.
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
@vjeux Status bar style could be a barStyle
property on NavigatorIOS. Another idea would be to add barStyle
as an additional attribute to RKNavigatorItem
. I think i'm leaning towards the latter because it allows each route to define a bar style.
from react-native.
@amccloud: the status bar is not tied to the navigator. If you have an empty view, you still have the status bar.
Maybe we can have a module
var { StatusBarIOS } = require('react-native');
StatusBarIOS.setStyle(StatusBarIOS.style.lightContent);
And, the way you would do it is in the root react component
componentDidMount: function() {
StatusBarIOS.setStyle(StatusBarIOS.style.lightContent);
},
What do you think about this API?
from react-native.
Then, if you have this API, you can create the <Application>
component that you suggested @nick
var Application = React.createClass({
componentWillReceiveProps(nextProps) {
if (this.props.statusBarStyle !== nextProps.statusBarStyle) {
StatusBarIOS.setStyle(nextProps.statusBarStyle);
}
},
render() {
var {statusBarStyle, children, ...props} = this.props;
return <View {...props}>{children}</View>
}
});
from react-native.
I like StatusBarIOS
suggestion. Some people will definitely want to .hide()
and .show()
status bar, and it gives enough power to implement higher level abstractions like <Application>
or navigator/routing integration.
from react-native.
StatusBarIOS
sounds great :)
from react-native.
@nick: want to give a shot at implementing it?
from react-native.
I also like StatusBarIOS. Trying to implement it now to learn the internals of react-native.
from react-native.
@vjeux Unfortunately I have no experience whatsoever with iOS or Objective C otherwise I'd be happy to help. @amccloud good luck - would love to give it a try if you succeed
from react-native.
@nick: gotta start somewhere? :p
from react-native.
@vjeux haha you're right I should dive in. Right now I'm working on a clone of the iOS weather app to see how far I can get it. Looking good so far! My fork is at nick/react-native - when I'm a bit further along perhaps we could use it as another example.
from react-native.
Oh, that's pretty cool already!
from react-native.
Yup no prior iOS experience and about 3 hours work I got it to that. It's using https://github.com/erikflowers/weather-icons for the icons. Looking forward to seeing how far I can push it
from react-native.
@nick no regrets about giving you access :) - demo looks sick!
from react-native.
Hey nick! Long time no see.
FWIW, when I wanted to change the status bar style of my app, I did it in the Info.plist
from react-native.
I've pushed my initial work for StatusBarIOS. @vjeux the only issue I seem to run into is the type for attributes coming across the bridge. For example my BOOL
values in RCTStatusBarManager
are always NO
or false
.
from react-native.
Wow, so fast! Looking
from react-native.
I merged in @amccloud 's change to my fork and its working great :-)
from react-native.
@amccloud do you mind doing a pull request on this repo?
from react-native.
Yes. That is my intention. I just want to fix the issue with the BOOL values first.
from react-native.
@a2 @nicklockwood do you know what's going on with the BOOL value?
from react-native.
Just catching up on email. I commented on why that's not working. Hopefully that helps. :)
from react-native.
@amccloud @vjeux do you think I can use the same method to expose a location API? Trying to get location for my Weather app and was thinking of using this code as a template.
from react-native.
@nick: yeah, integrations with the native apis will follow a similar pattern.
It turns out that we already have the location api implemented internally but haven't yet had the time to put it on the open source version. Give us some time on this (you can expose it for yourself in the meantime, shouldn't be super hard)
from react-native.
Was added 9674c99 :)
from react-native.
Related Issues (20)
- `fontVariant` doesn't work on iOS when using the new architecture
- UI problem with iOS floating keyboard in iPad. HOT 6
- TouchableWithoutFeedback does not support style HOT 1
- Cannot find EventEmitter for receivedTouches EventName[topTouchMove, topTouchEnd] on native library HOT 5
- RCTNativeAnimatedNodesManager.mm props is not a node HOT 1
- Unexpected scroll behaviors when using FlatList HOT 7
- When I integration react native with Existing Android Apps,I got a autolinking question. HOT 2
- Symbol not found: (_JSGlobalContextSetInspectable) HOT 2
- The directory ****/ios contains 2 projects HOT 3
- textInput props textAlign will cause long text to be cut off after the hyphen when out of focus and focus again
- close the first modal with animation, then open the second modal immediately, the second modal can't be showed HOT 2
- UI updates made from layout effect are flushed in separate UI transaction HOT 4
- Blob constructor is not spec compliant HOT 1
- [!] CocoaPods could not find compatible versions for pod "React-RCTAnimation": In Podfile: React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) HOT 3
- Build error in 0.73.6 HOT 3
- Fatal error "available height is undefined" when editing textinput the app closes HOT 3
- Inverted Flatlist not working when scrolled HOT 5
- `TextInput` cursor lags behind text when component is controlled if Auto-Correction and Predictive Text are enabled HOT 3
- RNSVG same register view HOT 4
- Firestore encountered gRPC-C++ error while upgrading Firebase module to 19.2(iOS) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native.