【问题标题】:dynamically set size of indeterminate ProgressBar on ActionBar在 ActionBar 上动态设置不确定 ProgressBar 的大小
【发布时间】:2013-08-05 08:34:03
【问题描述】:

我在网络调用期间在操作栏上实现了进度条,但在操作栏上显示的进度条太大。我想设置进度条的动态大小。我搜索了很多但没有达到我的目标。所以下面是 ActionBar ProgressBar 的代码。请任何人给我一些答案,任何有其他方法来完成上述任务的人请告诉我。

    protected void onCreate(Bundle savedInstanceState) {

        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); }

    protected void onPreExecute() {

            // Show IndeterminateProgressBar

            setSupportProgressBarIndeterminateVisibility(true); }

    protected void onPostExecute(Void result) {

            setSupportProgressBarIndeterminateVisibility(false);}

提前致谢

【问题讨论】:

标签: android android-layout android-actionbar android-progressbar


【解决方案1】:

设置一个 Timer 并使用 LayoutParams 来改变大小。

{ParentLayout}.LayoutParams params = new {ParentLayout}.LayoutParams(h,w); 
progressBar.setLayoutParams(params);

并使用内置的java Timer来计时。

【讨论】:

    猜你喜欢
    • 2012-02-28
    • 2014-03-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-09
    • 1970-01-01
    相关资源
    最近更新 更多