How to create 'Horizontal style' progress bar programmatically in Android?
I am creating a ProgressBar in my app programmatically it is of SPIN style by default however I want it in HORIZONTAL style. I don't see any method/constant to achieve this. And I don't want to use ProgressDialog as it'd be inconsistent with my App UI theme. Any suggestions please? waqaslam use this: ProgressBar pb = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal); If you are using a ProgressDialog then, here is a way to change the style of the progressBar in the ProgressDialog. mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); 来源: https:/