Closed
Description
react-native -v
: 0.46.4node -v
: 8.2.0npm -v
: 5.3.0yarn --version
: 0.27.5
Then, specify:
-
Target Platform:
Android -
Development Operating System:
macOS
Android SDK com.android.tools.build:gradle:2.3.3. buildToolsVersion '25.0.0'
my code is
import React, { Component} from 'react';
import {
StyleSheet,
Text,
View,
TouchableOpacity,
ART,
} from 'react-native';
var {
Group,
Shape,
Path,
Surface
} = ART;
export default class Circle extends Component {
render() {
var radius=100;
var path = Path();
path.move(0, 100)
.arc(100 * 2, 0, 100)
.arc(-100 * 2, 0, 100);
path.close();
var linePath = Path();
linePath.moveTo(radius,radius);
//linePath.lineTo(radius*2,100);
linePath.lineTo(radius*2-Math.sin(45),100);
return (
<View style={styles.container}>
<Surface width={200} height={200}>
<Group>
<Shape d={path} stroke="#000000" strokeWidth={1}/>
<Shape d={linePath} stroke="#000000" strokeWidth={1}/>
</Group>
</Surface>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
justifyContent: 'center',
alignItems: 'center',
padding:10,
backgroundColor:'#9b9b9b'
},
});
I hope to get the answer as soon as possible, thanks you!!