How to achieve 'FrameLayout' component in React Native?

后端 未结 2 454
北恋
北恋 2021-01-18 01:58

I know there is a \'View\' component in React Native that acts like Android VieGroup, how ever it is more likely to work as LinearLayout - childrens are arranged in rows or

2条回答
  •  鱼传尺愫
    2021-01-18 02:30

    You can do overlay this way import React, { Component } from "react"; import { Animated, View, StyleSheet, Easing, Text } from "react-native";

    class A extends Component {
      constructor(props) {
        super(props);
        this.animatedValue = new Animated.Value(0);
      }
    
      handleAnimation = () => {
        Animated.timing(this.animatedValue, {
          toValue: 1,
          duration: 500,
          easing: Easing.ease
        }).start();
      };
    
      render() {
        return (
          
    
            
            
              This is an overlay area
            
          
        );
      }
    }
    
    const styles = StyleSheet.create({
      container: {
        flex: 1
      },
      layer1: {
        height:100,
        backgroundColor: "lightgreen",
    
      },
      overLay: {
        height: 100,
        width: "100%",
        backgroundColor: "#00000070",
        position: "absolute",
    
      }
    });
    
    export default A;
    

提交回复
热议问题