Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide panel as default #1

Open
kenchengch opened this issue May 16, 2016 · 4 comments
Open

hide panel as default #1

kenchengch opened this issue May 16, 2016 · 4 comments

Comments

@kenchengch
Copy link

how to do this on react native? I know display:none is not work.

@shally12
Copy link

+1

@MatthiasVervaet
Copy link

  _setMaxHeight(event) {
    if (!this.state.maxHeight) {
      this.setState({
        maxHeight: event.nativeEvent.layout.height,
      });
    }
  }

  _setMinHeight(event) {
    if (!this.state.minHeight) {
      this.setState({
        minHeight: event.nativeEvent.layout.height,
        animation: new Animated.Value(event.nativeEvent.layout.height),
      });
    }
  }

and set expanded to false

@prasann278
Copy link

prasann278 commented Feb 17, 2017

@MatthiasVervaet thanks a lot now it is working for me

i have replaced below code in panel .js :-

       _setMaxHeight(event){
        this.setState({
        maxHeight   : event.nativeEvent.layout.height
     });
 }

_setMinHeight(event){
    this.setState({
        minHeight   : event.nativeEvent.layout.height
    });
}

With this code:-

_setMaxHeight(event) {
    if (!this.state.maxHeight) {
     this.setState({
     maxHeight: event.nativeEvent.layout.height,
     });
   }
 }

            _setMinHeight(event) {
             if (!this.state.minHeight) {
              this.setState({
            minHeight: event.nativeEvent.layout.height,
              animation: new Animated.Value(event.nativeEvent.layout.height),
            });
            }
           }

It is Working fine for me

@prasann278
Copy link

prasann278 commented Feb 23, 2017

@crysfel
@MatthiasVervaet
@hungdev
When i m keeping the Header under the return

it is not reflecting on the screen

           import React,{AppRegistry,StyleSheet,Text,ScrollView,Header,Button,Title,Icon,View,Image} from                 'react-native';
        import Head from './components/Header'
              import Panel from './components/Panel';

         var Panels = React.createClass({
          render: function() {
              return (
         <View>
            <Head/>


        <ScrollView style={styles.container}>
            <View style={styles.subScroll}>

            <View style={styles.border1}></View>
                        <Panel title="How does Auto Renew Work?" style={{borderBottomWidth:2,borderBottomColor:'blue'}}>
                <Text style={styles.panelCon}>Funko is an American company that manufactures licensed pop culture toys.</Text>
            </Panel>
            <View style={styles.border1}></View>

            <Panel title="What is the difference between subscription plans?" style={{borderBottomWidth:2,borderBottomColor:'blue'}}>
                <Text style={styles.panelCon}>Funko is an American company that manufactures licensed pop culture toys. Funko is most known for producing over 1000 different licensed vinyl figures. In addition Funko produces licensed plush, bobbleheads, action figures, and licensed electronic items such as USB drives, lamps and headphones.</Text>
            </Panel>
            <View style={styles.border1}></View>

this is showing error plzz help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants