Skip to content

In android,set view zIndex,get falut,but in iOS OK #16027

@jf4444

Description

@jf4444

Is this a bug report?

(YES)

Have you read the Contributing Guidelines?

(YES)

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: 8.2.0
Yarn: 0.27.5
npm: 5.4.2
Watchman: 4.7.0
Xcode: Xcode 8.3.3 Build version 8E3004b
Android Studio: 2.3 AI-162.3934792

Packages: (wanted => installed)
react: ^16.0.0-alpha.12 => 16.0.0-rc.3
react-native: 0.48.1 => 0.48.1

Steps to Reproduce

(Write your steps here:)

1.I have the view a b c, set zIndex 80,70,60,
2.render flex a b c
3.i have a this.state.bool to display or hidden view c
4:change the state value

Expected Behavior

use zIndex,run OK,like IOS

Actual Behavior

when changed state value, the view a,and b disappear
the code is here:

   render() {
        if (this.props.visible === false) {
           return (
              null
          );
    }

    return (
        <View style={[{ position: 'absolute',marginTop:this.to},this.props.cStyle]}>
            <View style={[styles.container,{width:this.width,height:this.height}]}>
                <View style={ styles.loadingImage }>
                    <Image style={ styles.loadingImage } source={require('../../Resources/Gif/sp_loading.gif')}/>
                </View>
            </View>
        </View>
    );
}

but when I write code like this(not return null,renturn ),It's ok on device of android

  render() {
        if (this.props.visible === false) {
             return (
                 <View></View>
            );
    }

    return (
        <View style={[{ position: 'absolute',marginTop:this.to},this.props.cStyle]}>
            <View style={[styles.container,{width:this.width,height:this.height}]}>
                <View style={ styles.loadingImage }>
                    <Image style={ styles.loadingImage } source={require('../../Resources/Gif/sp_loading.gif')}/>
                </View>
            </View>
        </View>
    );
}

Reproducible Demo

Metadata

Metadata

Labels

Issue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.StaleThere has been a lack of activity on this issue and it may be closed soon.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions