【问题标题】:ReactNative: overflow is not working for AndroidReactNative:溢出不适用于 Android
【发布时间】:2018-03-26 14:42:22
【问题描述】:

我在我的应用程序中使用 React-Native。我使用overflow 来显示主视图之外的视图。它在 iOS 上运行良好,但在 Android 上却不行。

这是我的代码:

 <View style={Style.parentStyle}>
<View
    style={[
        {
            height: barHeight,
            backgroundColor: color,
            overflow: "visible"
        },
        Style.mainStyle
    ]}
>
    <View
        style={[
            {
                borderRadius: shadowHeight,
                top: -borderRadiusBar,
                borderWidth: 1.0,
                borderColor: borderColor,
                backgroundColor: color,
                overflow: "visible"
            },
            Style.roundStyle
        ]}
    >
        <Text style={Style.otherstyle}>{player value}</Text>
    </View>
</View>
<Text style={Style.textStyle}>{name}</Text>
</View>;

风格:

  parentStyle: {
        flex: 1,
        backgroundColor: 'transparent',
        marginLeft: 1,
        marginRight: 2,
        justifyContent: 'flex-end',
        overflow: 'visible',
    },
    mainStyle: {
        justifyContent: 'flex-start',
        alignItems: 'center',
        borderRadius: 0,
        overflow: 'visible',
    },

【问题讨论】:

    标签: android react-native overflow


    【解决方案1】:

    Android 尚不支持overflow 属性。但是你可以支持功能请求here

    Element overflow hidden in React-Native Android 的副本

    【讨论】:

      【解决方案2】:

      由于一些本地限制,它还不能工作,所以所有溢出的项目都将被隐藏。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-01-11
        • 1970-01-01
        • 1970-01-01
        • 2015-10-08
        • 1970-01-01
        • 1970-01-01
        • 2013-09-10
        • 2018-10-04
        相关资源
        最近更新 更多