-
-
Notifications
You must be signed in to change notification settings - Fork 605
Open
Labels
Platform: iOSThis issue is specific to iOSThis issue is specific to iOSRepro providedA reproduction with a snack or repo is providedA reproduction with a snack or repo is provided
Description
Description
I have a screen with presentation set to formsheet. I want to have a header view, body scrollview, and a footer view. on Android it works fine, but on iOS the header is not displayed and weird thing that the background color of the scrollview extends beyond the footer as well as the scrollview is not fully flexed.
Example Code
// In App.js in a new project
import * as React from 'react';
import { View, Text, Button, ScrollView } from 'react-native';
import {
createStaticNavigation,
StaticParamList,
useNavigation,
} from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
function HomeScreen() {
const navigation = useNavigation();
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Button title="Go to Form" onPress={() => navigation.navigate('Form')} />
</View>
);
}
function Formsheet() {
return (
<View style={{ flex: 1 }}>
<View style={{ backgroundColor: 'red' }}>
<Text>Header</Text>
</View>
<ScrollView style={{ flex: 1, backgroundColor: 'green' }}>
<Text>Content</Text>
</ScrollView>
<View style={{ backgroundColor: 'blue' }}>
<Text>Footer</Text>
</View>
</View>
);
}
const RootStack = createNativeStackNavigator({
screens: {
Home: HomeScreen,
Form: {
screen: Formsheet,
options: {
presentation: 'formSheet',
headerShown: false,
},
},
},
});
type RootStackParamList = StaticParamList<typeof RootStack>;
declare global {
namespace ReactNavigation {
interface RootParamList extends RootStackParamList {}
}
}
const Navigation = createStaticNavigation(RootStack);
export default function App() {
return <Navigation />;
}Screenshots
| Before | After |
|---|---|
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-07-07.at.10.20.25.mp4 |
Screen.Recording.2025-07-07.at.10.20.31.AM.mov |
I did get the following warning:
(NOBRIDGE) WARN [RNScreens] FormSheet with ScrollView expects at most 2 subviews. Got 5. This might result in incorrect layout. If you want to display header alongside the scrollView, make sure to apply `collapsable: false` on your header component view.Removing the footer and leaving the header view as well as body scrollview with header view passed collapsible still does not render the header.
Example Code
// In App.js in a new project
import * as React from 'react';
import { View, Text, Button, ScrollView } from 'react-native';
import {
createStaticNavigation,
StaticParamList,
useNavigation,
} from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
function HomeScreen() {
const navigation = useNavigation();
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Button title="Go to Form" onPress={() => navigation.navigate('Form')} />
</View>
);
}
function Formsheet() {
return (
<View style={{ flex: 1 }}>
<View collapsable style={{ backgroundColor: 'red' }}>
<Text>Header</Text>
</View>
<ScrollView style={{ flex: 1, backgroundColor: 'green' }}>
<Text>Content</Text>
</ScrollView>
</View>
);
}
const RootStack = createNativeStackNavigator({
screens: {
Home: HomeScreen,
Form: {
screen: Formsheet,
options: {
presentation: 'formSheet',
headerShown: false,
},
},
},
});
type RootStackParamList = StaticParamList<typeof RootStack>;
declare global {
namespace ReactNavigation {
interface RootParamList extends RootStackParamList {}
}
}
const Navigation = createStaticNavigation(RootStack);
export default function App() {
return <Navigation />;
}Screenshots
| Before | After |
|---|---|
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-07-07.at.10.23.11.mp4 |
Screen.Recording.2025-07-07.at.10.23.23.AM.mov |
Steps to reproduce
- Clone repo or example code
- run app on ios and tap on
go to form - Note how on iOS the header is not displayed, the background color of the scrollview extends beyond the footer as well as the scrollview is not fully flexed.
Snack or a link to a repository
https://github.com/itsramiel/Formsheet
Screens version
4.11.1
React Native version
0.80.1
Platforms
iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
enu-kuro
Metadata
Metadata
Assignees
Labels
Platform: iOSThis issue is specific to iOSThis issue is specific to iOSRepro providedA reproduction with a snack or repo is providedA reproduction with a snack or repo is provided