首页 > 解决方案 > 为什么 react-native-calendar-picker 本身会包装其他元素?

问题描述

嗨,我是新来的本地人。我试图向应用程序添加一个日历日期选择器,它可以正常工作

反应本机日历选择器

但是我尝试在它下面添加另一个视图,但是,元素没有添加到外面,相反,日历元素的高度越来越长,并且隐藏了我在它之后添加的任何内容。

<ScrollView style={styles.scrollMain} >


                        <Text style={{fontSize:15}}>Mark the dates and time you are available</Text>
                        <View  style={styles.nurseCalendar} >
                        <CalendarPicker
                            dayShape='circle'
                            todayBackgroundColor={'#88B3F9'}
                            selectedDayTextColor={"#FFFFFF"}
                            selectedDayStyle={styles.calendarStyle}
                            nextTitle='>>>'
                            width={340}
                            height={342}
                            restrictMonthNavigation={true}
                            minDate={Date.now()}
                            onDateChange={this.handleDateChange}
                            previousTitle='<<<'
                        ></CalendarPicker>
                        </View>
                      <View>/** no matter what i add here won't show however the view above will increase in height **/</View>
                    </ScrollView>

这是我正在使用的样式属性:

scrollMain:{
            alignContent:'center',
            flexDirection:'column',
            paddingTop:25,
            paddingLeft:25,
            paddingRight:25,
            backgroundColor:'#F7F9FC'
        },
        nurseCalendar:{
            width:'90%',
            alignSelf:'center',
            marginTop:25,
            height:'100%',
            backgroundColor:'#fff',
            flexWrap:'wrap'


        },
        calendarStyle:{
            borderColor: '#6574CF',
            backgroundColor: 'dodgerblue',
            color: 'white',
            borderWidth: 2,
            borderRadius: 50,

        }

标签: reactjsreact-native

解决方案


推荐阅读