2017-01-09 27 views
2

私はコンポーネントを含むヘッダーを持っています。このヘッダーには、AndroidとiOSのシャドウが必要です。それはiOS上で動作しますが、アンドロイドには何も表示しません。 documentationで述べたように反応しませんでした:アンドロイドには表示されません。

class Toolbar extends Component { 

    render() { 
    return (
     <View style={[styles.toolBar, this.props.style]}> 
     {this.props.children} 
     </View> 
    ); 
    } 
} 

const styles = StyleSheet.create({ 
    toolBar: { 
    zIndex: 1, 
    flex: 1, 
    flexDirection: 'row', 
    justifyContent: 'space-between', 
    height: topBarHeight, 
    backgroundColor: colors.base, 
    elevation: 5, 
    shadowOpacity: 0.3, 
    shadowRadius: 1, 
    shadowOffset: { 
     height: 2, 
     width: 0 
    } 
    } 
}); 

答えて

1

、影の小道具は(shadowColorshadowOffsetshadowOpacityshadowRadius)のみのiOSで動作します。

+0

はい、iOS専用です。 – salam3224

0

ビューを表示しない場合は、zIndexと標高を1つのスタイルで使用しないでください。アンドロイドのzIndexをゼロに設定します。

zIndex: (Platform.OS == 'ios') ? 1 : 0 
関連する問題