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

Đang mở
#778 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, react-native
Lĩnh vực
frontend, mobile

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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}
        />
      ),
  }}
/>
Ngôn ngữ chính
JavaScript
Star
2.9k
Fork
459
Merge trung bình
4 ngày 16 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của react-native-datetimepicker/datetimepicker

Tất cả issue của react-native-datetimepicker/datetimepicker

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.