1

I'm trying to implement an Android ProgressBar but its size is taking the whole screen. I've followed a couple of examples but it didn't make any effect.

Here is my code

<ProgressBar
        android:id="@+id/progress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:indeterminate="false"
        android:padding="45dp"
        android:visibility="gone" />
Luis Paulino
  • 107
  • 1
  • 11

1 Answers1

0

The ProgressBar is taking the whole screen size, probably because you've set the layout-width and/or layout-height to match-parent.

So try changing those.

Or, if you set the layout-width and layout-height to 0dp on a ConstraintLayout, then make sure you're not setting the Constraints to parent on all / opposite sides.

If you're using a LinearLayout, and if you've set either the layout-width or layout-height to 0dp, then make sure you aren't setting the layout-weight to a size that's too different from the layout-weight of the other widgets of the layout.

Hope this helped. Next time, please post your code or even a screenshot. That makes it a lot easier for all of us.