3

I need to increase the Size(height) of the progress bar. Any suggestions would b helpful.

I am using ProgressViewIOS native component.

sathish
  • 800
  • 1
  • 8
  • 19
  • Tried using, height: 5, lineHeight: 50, minHeight: 10, borderRadius: 10. But not achieved the desired output. – sathish May 25 '17 at 10:44
  • https://stackoverflow.com/a/27368779/4417447 Use this, if you are using native progress view control. – santak May 25 '17 at 10:46

4 Answers4

8

The use of transform property is correct. Its syntax should be something like

<ProgressViewIOS style={styles.progressBar}/>

const styles = StyleSheet.create({
  progressBar: {
    width: 100,
    transform: [{ scaleX: 1.0 }, { scaleY: 2.5 }],
  }
})
2

I was able to achieve height manipulation using the transform style property.

transform: 'scaleX(1.0) scaleY(3.0)'

changing the scaleY number will increase or decrease the height.

stims
  • 168
  • 4
1

For swift 3

progressView.transform = CGAffineTransform(scaleX: 1.0, y: 5.0)

santak
  • 327
  • 1
  • 13
  • This question is about React Native, not native development. ProgressViewIOS is a React Native component. – Jaybo Jan 22 '18 at 02:26
1

This is how I fixed my issue. You need to style the transform and the height.

style={{transform: [{ scaleX: 1.0 }, { scaleY: 4}], height:12}}

Happy coding!

{( Platform.OS === 'android' )
    ?
    ( <ProgressBarAndroid progressTintColor="#4a90e2" progress = { this.state.progress } styleAttr = "Horizontal" indeterminate = { false } /> )
    :
    ( <ProgressViewIOS style={{transform: [{ scaleX: 1.0 }, { scaleY: 4}], height:12}} progressTintColor="#4a90e2" progress = { this.state.progress } /> )
 }
DeiDei
  • 10,205
  • 6
  • 55
  • 80