Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

Progress.pie中的属性color,borderWith,borderColor中内圆的颜色,在进行静态配置的时候颜色显示正常,在使用Button进行动态改变的时候,中间的圆会显示黑色和默认的颜色不一致 #8

@1032415214

Description

@1032415214

const [color, setColor] = React.useState('red');
const colorCounter = () => {
setColor(count => {
if (count == 'red') {
return 'green';
}
if (count == 'green') {
return 'blue';
}
if (count == 'blue') {
return 'yellow';
}
if (count == 'yellow') {
return 'red';
}
return 'green'
});
};

<Text style={styles.welcome}>Progress Pie color</Text>
  <View style={styles.circles}>
     <Progress.Pie
      style={styles.progress}
      progress={0.6}
      size={80}
      borderWidth={5}
    /> 
     <Progress.Pie
      style={styles.progress}
      progress={progress}
      size={80}
      borderWidth={5}
      color={'rgba(0, 122, 255, 1)'}
    /> 
     <Progress.Pie
      style={styles.progress}
      progress={0.6}
      size={80}
      borderWidth={5}
      color={'red'}
    /> 
    <Progress.Pie
      style={styles.progress}
      progress={0.6}
      size={80}
      borderWidth={5}
      color={color}
    />
    <Button
      title="Press me!"
      onPress={colorCounter}
    />
  </View>

color,borderWith,borderColor 属性在进行直接配置的时候如:color={‘red’} 显示正常,但是在通过button进行动态配置的时候中间的圆会显示黑色和默认的颜色不一致,需要定位修改,具体demo可以参考:https://github.com/react-native-oh-library/RNOHDCS/blob/main/progressDemo/progressPie.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions