Progress.Bar progress starting from center
See original GitHub issueProgress.Bar
is rendering with the progress beginning from near the middle of the bar, then expanding to fill the bar at 100% as demonstrated in this screenshot:
Any ideas what’s going on here? I’ve experimented with various styles and Progress.Bar properties and nothing seems to change the behavior.
This is with “react-native”: “0.61.4”, running in the iOS Simulator (iPad 7, OS 13.3)
Here’s a subset of my code that at least demonstrates how I’m using the progress bar in the layout and it’s styling, although this code isn’t functional as I quickly extracted the rest of my non-relevant view code:
import React, { Component } from 'react';
import {
StyleSheet,
SafeAreaView,
} from 'react-native';
import { WebView } from 'react-native-webview';
import * as Progress from 'react-native-progress';
import type { WebBrowser } from './WebBrowser';
const styles = StyleSheet.create({
container: {
flex: 1,
},
webView: {
flex: 1,
},
progressBar: {
position: 'absolute',
flex: 1,
top: 0,
height: 6,
width: '100%',
borderRadius: 0,
},
});
/**
* View for content reading.
*/
export default
class ContentReaderView extends Component<{
viewModel: ContentReaderViewModel,
}>
render() {
const { viewModel } = this.props;
return (
<SafeAreaView style={styles.container}>
<WebView
style={styles.webView}
/>
{ viewModel.isLoading && (
<Progress.Bar
style={styles.progressBar}
progress={viewModel.loadProgress}
/>
}
</SafeAreaView>
);
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
bootstrap center progressbar on div - Stack Overflow
I'm trying to use a Bootstrap progress ...
Read more >Progress - Bootstrap
Documentation and examples for using Bootstrap custom progress bars featuring support for stacked bars, animated backgrounds, and text labels.
Read more >How can i align center progress bar ? | Sololearn
You can wrap the <progress> in a <div> whose 'align' attribute set to "center". copied the code from w3schools.
Read more >W3.CSS Progress Bars - W3Schools
Add text inside a w3-container element to add a label to the progress bar. Use the w3-center class to center the label. If...
Read more >The Progress Indicator element - HTML - MDN Web Docs
It must be a valid floating point number between 0 and max , or between 0 and 1 if max is omitted. If...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@HolySamosa, can you please try setting
width
asnull
instead of handling it via CSS?Reference: https://github.com/oblador/react-native-progress#progressbar
For
width
property:I hope that solves your problem; if not, please let me know. 😃
Whoops. Somehow I missed the earlier notifications for this thread. @kunalmhatre, I’ll give your suggestion a try. @hardikramoliya, did you have the same issue and did this solve your problem?
Thanks!