Giter Club home page Giter Club logo

Comments (6)

xwenliang avatar xwenliang commented on August 26, 2024

I just want to make an animation for the Picker show,
At first, make outer view {{height: Dimensions.get('window').height}}, and make the Picker
{{bottom: 0, position: 'absolute'}}, then we can slideUp the Picker when we clicked the 'show button'.
If you want to show Picker at first, you can change the style of outer view or style of Picker.

from react-native-picker.

Taakn avatar Taakn commented on August 26, 2024

@xwenliang what I am trying to say is that the components displayed after the picker get pushed back outside of the screen, because the outer view height is the height of the screen.

Moreover, components being displayed after the picker are displayed above the picker if you do not set {{height: Dimensions.get('window').height}}

So that's my question: how do you display components after the picker so they don't get pushed outside of the screen, and do not display above the picker?

Thanks!

from react-native-picker.

Taakn avatar Taakn commented on August 26, 2024

I mean it works if you place the picker very last in the component list then you can have the button opening it anywhere... But is there another, more elegant, way than splitting up the two?

from react-native-picker.

xwenliang avatar xwenliang commented on August 26, 2024

I add customized style support for the picker in v0.4.1, I have no idea if this could make sense for you.

1

render(){
    return (
        <View>
            <View style={{height: 100, paddingTop: 80, backgroundColor: 'red'}}>
                <Text>this is something above picker</Text>
            </View>
            <View style={{height: 240, position: 'relative', backgroundColor: 'green'}}>
                <Picker
                    ref={picker => this.picker = picker}
                    pickerHeight={240}
                    showDuration={300}
                    pickerData={createDateData()}
                    selectedValue={['2015年', '12月', '12日']}
                    onPickerDone={(pickedValue) => {
                        console.log(pickedValue);
                    }}
                    style={{top: 0}}
                    pickerToolBarStyle={{height: 0, opacity: 0}}
                />
            </View>
            <View style={{height: 100, backgroundColor: 'yellow'}}>
                <Text>this is something below picker</Text>
            </View>
        </View>
    );
}

from react-native-picker.

Taakn avatar Taakn commented on August 26, 2024

Thanks I'm closing the issue.

from react-native-picker.

alexlevy0 avatar alexlevy0 commented on August 26, 2024

@xwenliang Is it still possible to display the picker with a component on the bottom as in your image?

from react-native-picker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.