datetimepicker
datetimepicker copied to clipboard
Using "compact" Picker on iOS in headerTitle component of Stack.Screen pushes it to the left rather than centre
Question
Hi, I'm using the latest Expo supported version 6.7.3 so hopefully this is fixed in a later version but currently when I attempt to use the picker as the header component of Screen the header get's pushed to the left. With any other combination of controls this isn't the case. Is there a workaround for this or some other approach I can use?
Thanks!
<Stack.Screen
options={{
title: 'Logbook',
headerTitle: () =>
Platform.OS === 'android' ? (
<Button
title={format(date, 'dd/MM/yyyy')}
type="clear"
onPress={handlePress}
buttonStyle={{
backgroundColor: Color(theme.colors.primary)
.alpha(0.2)
.string(),
}}
size="sm"
/>
) : (
<DateTimePicker
value={date}
is24Hour
onChange={handleDateChange}
display="compact"
/>
),
headerRight: () =>
selectedIds.length > 0 && (
<Icon
name="label"
type="material-icons"
color={theme.colors.primary}
onPress={handleClassificationPress}
/>
),
}}
/>