dateNameStyle and dateNumberStyle not working on iOS
See original GitHub issueHere’s my code:
return (
<CalendarStrip
scrollable
style={{
height: 100,
}}
iconStyle={{ display: "none" }}
calendarHeaderStyle={{
color: theme.text.primary,
fontFamily: fontName,
}}
dateNumberStyle={[styles.dateNumberStyle, { color: theme.text.primary }]}
weekendDateNumberStyle={[
styles.dateNumberStyle,
{ color: theme.accent.secondary },
]}
dateNameStyle={{
color: theme.accent.secondary,
fontFamily: fontName,
}}
weekendDateNameStyle={{
color: theme.accent.secondary,
fontFamily: fontName,
}}
highlightDateNumberStyle={[
styles.dateNumberStyle,
{
color: theme.text.secondary,
backgroundColor: theme.text.primary,
borderRadius: 8,
},
]}
highlightDateNameStyle={{
color: theme.text.primary,
fontFamily: fontName,
}}
onDateSelected={(date) => handleDateSelect(date)}
calendarHeaderPosition="below"
customDatesStyles={[
{
// format today
startDate: new Date().toUTCString(),
dateNumberStyle: {
backgroundColor: "red",
color: "green",
},
dateNameStyle: {
backgroundColor: "red",
color: "green",
},
highlightDateNameStyle: {
backgroundColor: "red",
color: "green",
},
highlightDateNumberStyle: {
backgroundColor: "red",
color: "green",
},
},
]}
/>
);
This is what it looks like on my Android emulator on my PC:
This is what it looks like on my physical iOS device: (I am using Expo)
So I am not really sure what’s going on here but it seems like some styles get applied while some do not? Not sure if it’s a bug or if I’m doing something wrong…
Here’s also my styles obj if it makes any difference:
const styles = StyleSheet.create({
dateNumberStyle: {
fontFamily: fontName,
padding: 4,
marginBottom: 4,
width: 34,
height: 34,
},
});
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
dateNameStyle and dateNumberStyle not working on iOS
Try adding borderRadius to highlightDateContainerStyle . You applied borderRadius to highlightDateNumberStyle which is only for the text within the container.
Read more >onWeekChanged keeps getting called infinitely render #326
dateText} dateNumberStyle={styles.dateText} iconLeftStyle={{ height: vh(20), ... OS === 'ios' ? vh(45) : vh(60)} selectedDate={props.
Read more >How to dynamically set marked dates from api in react-native ...
Here you can do it through the loop. Just add this loop before CalenderStripe Tag for parsing markedDates and there you go. Solution:...
Read more >[Solved]-Calendar strip is not behaving as it should-React Native
Coding example for the question Calendar strip is not behaving as it should-React Native.
Read more >react-native-calendar-strip - npm
It supports iOS & Android and responsively sizes its height based on ... dateNameStyle: (optional, see above); dateNumberStyle: (optional, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Published in 2.1.7
Another PR #272 is up, which implements another prop to avoid this issue.