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

Offen
#778 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
javascript, react-native
Bereich
frontend, mobile

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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}
        />
      ),
  }}
/>
Vorherrschende Sprache
JavaScript
Sterne
2.9k
Forks
459
Ø Merge
4 T. 16 Std.
Gemergte PRs (30 T.)
5

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus react-native-datetimepicker/datetimepicker

Alle Issues in react-native-datetimepicker/datetimepicker

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.