Using "compact" Picker on iOS in headerTitle component of Stack.Screen pushes it to the left rather than centre

Ouverte
#778 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
javascript, react-native
Domaine
frontend, mobile

Piste de recherche

Start by reproducing the issue with the provided Stack.Screen example, which uses DateTimePicker with display="compact" as headerTitle on iOS. Check the repository's iOS picker and navigation examples or tests for header layout behavior. Done means the compact picker remains centered in the header; the issue does not name a specific source file or test.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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}
        />
      ),
  }}
/>
Langage dominant
JavaScript
Étoiles
2.9k
Forks
459
Merge moyen
4 j 16 h
PR mergées (30 j)
5

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de react-native-datetimepicker/datetimepicker

Toutes les issues de react-native-datetimepicker/datetimepicker

Issues similaires

Plus d'issues JavaScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.