Change react-native-ui-library sectionWheelPicker style?

  Kiến thức lập trình

So im using RNUILIB to make a time selection menu for an alarm app, however i can’t seem to change the background color of the SectionsWheelPicker Component


const TimePicker = ({ onTimeChange }) => {

  const hours = Array.from({ length: 12 }, (_, i) => ({ label: (i + 1).toString(), value: i + 1 }));
  const minutes = Array.from({ length: 60 }, (_, i) => ({ label: i.toString().padStart(2, '0'), value: i }));
  const periods = [{ label: 'AM', value: 'AM' }, { label: 'PM', value: 'PM' }];

  return (
    <View style={styles.container}>
      <SectionsWheelPicker
        sections={[
          { style: {flex: 1 }, items: hours, index: hours.findIndex(h => h.value === selectedHour) },
          { style: {flex: 1 }, items: minutes, index: minutes.findIndex(m => m.value === selectedMinute) },
          { style: {flex: 1 }, items: periods, index: periods.findIndex(p => p.value === selectedPeriod) }
        ]}
        onValueChange={handleTimeChange}
        activeTextColor={"#000"}
        inactiveTextColor={"#535353"}
        numberOfVisibleRows={3}
        textStyle={{ fontFamily: 'reg' }}
        itemHeight={80}
        faderProps={{ height: 0 }}
      />
    </View>
  );
};

i tried putting a style on the parent view that has backgroundColor: "#242424" and tried putting the same style on the SectionsWheelPicker and it didn’t work

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website Kho Theme wordpress Kho Theme WP Theme WP

LEAVE A COMMENT