jgkim / react-native-status-bar-size Goto Github PK
View Code? Open in Web Editor NEWWatch and respond to changes in the iOS status bar height
Home Page: https://www.npmjs.com/package/react-native-status-bar-size
Watch and respond to changes in the iOS status bar height
Home Page: https://www.npmjs.com/package/react-native-status-bar-size
I'm having trouble getting this to work with [email protected], due to peer dependency conflicts:
npm ERR! peerinvalid The package react-native does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants react-native@>= 0.7
npm ERR! peerinvalid Peer [email protected] wants react-native@^0.4.0
Any suggestions on how to fix this? Thanks.
Hi there,
I'm trying to get the iOS status bar height using this package
but then I'm not able to find and add libRNStatusBarSize.a file in my xcode after npm install
what am I missing?
any comments will be appreciated!
Works initially, but after a while it seems to say 20 when its zero, and zero when its 20.
When using RN >= 0.66 this error is thrown:
Invariant Violation: StatusBarIOS has been removed from React Native. Has been merged with StatusBar. See https://reactnative.dev/docs/statusbar
react-native-status-bar-size uses StatusBarIOS in the addListener function
Update:
โ I attempted working on a fix but I couldn't since I am blocked RN migrating the StatusBarIOS events to StatusBar
โ Related issue facebook/react-native#32297
On this line - https://github.com/brentvatne/react-native-status-bar-size/blob/master/StatusBarSizeIOS.js#L88
You're using a Function type as the key to index into an object. Is this a mistake?
I'm surprised you guys have // @flow
at the top of the file, because Flow would have caught the issue for you. At the moment, Flow insists on checking your module as part of my project, and I have no way to even stifle the Flow error short of forking your package.
I'm worried that the React Native APIs to hide the status bar can be overriden by the OS. This is particularly a problem for this reason: if you design your app to not include a status bar, but then iOS forces it to show for some reason, then it could break the design of your app.
I'm wondering if and when are the times it can be forced to show? Is it only phone calls or recording video in another app and that sort of thing? Or can it just appear for less important reasons (and often) whenever the iOS wants to?
Hi,
I have some issues getting the status bar size, in getInitialState() I get null when calling StatusBarSizeIOS.currentHeight.
Also, if I do device rotate left nothing will trigger, but then when I do device rotate right I get a 'willChange' event, and the value I get is 0, which is wrong completely.
So basically, I cannot get status bar size at all, and in rare occasions when I do get a value- it's wrong.
I installed from npm and had to change "RCTDeviceEventEmitter" to "DeviceEventEmitter" in a couple places in your code to make this work. Does npm have the latest version?
with RN 0.27.2
@brentvatne I get the same error as in react-native-video here as well:
Unable to resolve module logError
Could you fix this? :)
I'd like to make a change to react-native that will fix an issue with the current iOS status bar height calculation and expose an API as part of react-native.
NativeModules.StatusBarManager.getHeight
is going to go away and the format of the statusBarFrameDidChange
event will change, so this library will break. But there will be an API that replaces in in react-native itself.x
and width
frame properties, usage of them doesn't make sense and keeping them makes doing this cross-platform a mess (They are basically always x=0 and width=viewport.width; and because Android only has a status bar height definition I'd have to overcomplicate the Android StatusBarManager to also lookup screen width for something no-one would use)0
in landscape mode. I found a way to fix this by subtracting the y
offset of the root view. However this cannot be done before the status bar actually changes, so I have to drop the statusBarFrameWillChange
event.
frame.y + frame.height
and you'll get the value you had before.Does this sound ok?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.