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? 回答1: use this: ProgressBar pb = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal); 回答2: If you are using a ProgressDialog then, here is a way to change the style of the progressBar in the