最佳答案
下面是你在 RN 中的做法,还有一个关于零食的演示 - https://snack.expo.io/@noitsnack/circle-fill - super 简单,基本的<View>
与造型。如果你想要这个动画,同样容易,让我知道并提出另一个主题,我会在那里发布动画版本。
import React, { Component } from 'react';
import { Text, View, StyleSheet } from 'react-native';
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<View style={styles.circle}>
<View style={[styles.circleFill, { height:'25%' }]} />
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center'
},
circle: {
width: 196,
height: 196,
borderRadius: 196 / 2,
borderWidth: 2,
borderColor: '#000000',
overflow: 'hidden',
},
circleFill: {
backgroundColor: 'orange',
width: '100%',
bottom: 0,
position: 'absolute'
}
});
Android 屏幕截图:
关于reactjs - 从下到上逐渐填充一个圆圈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48853482/