android - ART 库在 native react 中不起作用

标签 android react-native

我尝试在 Android 手机的 react-native build 中使用 ART 库,但无论我在 Shape 中放入什么,都无法渲染黑色图像,如下所示:

enter image description here

我的代码:

import React from 'react';
import {
ART,
StyleSheet,
View,
Button,
} from 'react-native';

const {
Group,
Shape,
Surface,
} = ART;


export default class App extends React.Component {
    render() {
        return (
        <View style={styles.container}>
            <Surface width={500} height={500}>
                <Group x={0} y={0}>
                    <Shape
                      d="M10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80"
                      stroke="#555"
                      strokeWidth={1}
                     />
                </Group>
            </Surface>
        </View>
        );
    }
}

最佳答案

React Native 中的 ART 库对 Android 的支持不是很好。有很多问题。我认为以下是一个很好地链接到您的示例:

https://github.com/facebook/react-native/issues/17565

https://github.com/facebook/react-native/issues/17565#issuecomment-430897843

我会说尝试上面链接中的一些解决方案。希望这对您有所帮助!

关于android - ART 库在 native react 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53302552/

相关文章:

android - 使用 Facebook Api 从 Facebook 获取通知

android - 为什么建议将扩展 Room Database 的类抽象化?

android - react native 错误 : is also present at [:@react-native-firebase_admob] AndroidManifest. xml:18:13-29

java - 运行时添加 Gridview 中的新项目

javascript - react native : Draw on image with only JS code

reactjs - 依赖项与安装的expo包版本不兼容,找不到模块 'nocache'

react-native - Modal 上没有指针事件

Android Studio 从带有 sqlite 的数据库到 GridView 和标题列

react-native - React Native - TextInput inlineImageLeft 不工作

react-native - 在 ReactNative 中单击按钮时如何获取 TextInput 中的值