Closed FaizanMostafa closed 2 years ago
Indeed I am having the same problem. Maybe somebody can give a light here?
Having the same issue here, any news?
Having the same issue here, any news?
Unfortunately, No :(
Do you by any chance have translucent status bar in your app?
<StatusBar translucent />
It looks like the first time you show a notification, the library is updating your StatusBar.
Try setting the updateStatusBar
prop to false (it's true by default). It worked for me, however my case was different as I was drawing the app under Android status bar (same like on iOS).
https://github.com/testshallpass/react-native-dropdownalert/blob/master/docs/PROPS.md#statusbar
Do you by any chance have translucent status bar in your app?
<StatusBar translucent />
It looks like the first time you show a notification, the library is updating your StatusBar.
Try setting the
updateStatusBar
prop to false (it's true by default). It worked for me, however my case was different as I was drawing the app under Android status bar (same like on iOS).https://github.com/testshallpass/react-native-dropdownalert/blob/master/docs/PROPS.md#statusbar
thanks for the suggestion, i don't want to disable the status bar update though it solves my problem, but I added the translucent={true} prop to DropdownAlert and it changed the alert behavior as nothing went wrong on alert. But when i closed the app and reopened it, it was the same problem as before, i was seeing a top margin. :(
I am also having this issue.
If we set updateStatusBar={false} to the
Setting translucent={false} also is not desired cuz it will basically push the whole app down and have that top margin in there all the time.
this issue is only on Android, as far as I can tell
This approach worked for me.
<DropdownAlert updateStatusBar={false} defaultContainer={{ padding: 8, paddingTop: StatusBar.currentHeight }} ref={ref => AlertHelper.setDropDown(ref)} onClose={() => AlertHelper.invokeOnClose()} />
Same issue. The approach above doesn't seem to work with my setup.
the transluced prop still don't work for me 💔
my temporary solution:
App.tsx
<DropdownAlert
ref={ref => Alert.setRef(ref as AlertType)}
defaultContainer={{ padding: 8, paddingTop: StatusBar.currentHeight }}
updateStatusBar={false}
onClose={Alert.onClose}
/>
<StatusBar
translucent
backgroundColor="rgba(0, 0, 0, 0)"
barStyle="dark-content"
/>
Alert.tsx
export class Alert {
static ref: AlertType;
static setRef(ref: AlertType) {
this.ref = ref;
}
static onClose() {
StatusBar.setBarStyle('dark-content');
}
static success(title: string, message?: string) {
this.ref.alertWithType('success', title, message);
StatusBar.setBarStyle('light-content');
}
}
Closing as have not been able to reproduce using example project. Please try latest version and/or open new issue if it persists or suggested workarounds do not help.
Short Description
Layout is being suppressed down(seems like some sort of margin is being added on top) when the alert is displayed and app stays this way until i refresh the app by killing it or through react native dev menu!
Post alert layout distortion includes
An additional margin on top of header
bottom nav is also moved down as its text is hidden...
Screen layout before the alert...
Screen layout at the time of alert...
Screen layout after the alert...
Code Snippets / Usage
app.js component...
DropDownHolder component...
Usage...
Additional Information