【问题标题】:How to show a progress-bar on a如何显示进度条
【发布时间】:2019-03-25 08:18:47
【问题描述】:

我正在开发一个带有进度条的主页的应用程序我必须在幻灯片上表示许多进度条,我尝试了 ViewFlipper,但它仅适用于图像。我该怎么办。帮助。`

 viewFlipper=findViewById(R.id.Vi);
    b = findViewById(R.id.progressBar);
   viewFlipper.addView(b); //this doesn't work

布局

 <ViewFlipper
    android:id="@+id/Vi"
    android:layout_width="412dp"
    android:layout_height="263dp"
    android:layout_marginStart="8dp"
    android:layout_marginTop="8dp"
    android:layout_marginEnd="8dp"
    android:layout_marginBottom="8dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.110000014"></ViewFlipper>

幻灯片应该在哪里

【问题讨论】:

  • 使用布局,将进度条放在所需视图上方,并在需要显示/隐藏时更改其可见性。
  • 非常感谢。但我不明白“将进度条放在所需视图上方”

标签: java android progress-bar slideshow android-progressbar


【解决方案1】:

创建一个滚动视图并在回收器视图上添加进度条作为项目,以便在父应用的滚动视图上显示它们

【讨论】:

  • 不客气,你能接受答案吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-05-25
  • 1970-01-01
  • 2015-07-15
相关资源
最近更新 更多