Android - How to make an progressBar touching a bottom screen border

前端 未结 5 590
春和景丽
春和景丽 2021-01-24 23:30

I want a ProgressBar that is touching a bottom border of screen but with this piece of code, I am getting an little space between bar and screen border:



        
5条回答
  •  南笙
    南笙 (楼主)
    2021-01-25 00:18

    Here is a hack that could work:

    • Create a LinearLayout for your whole view; set the width and height to fill_parent for it and orientation to vertical
    • Now, since you know how many components will be in your view, just give them the right amounts of weights; except the last progressbar
    • For the progressbar, give it the smallest of all; that way, it will be pushed all the way to the bottom;
    • Finally, using padding to reduce the space between it and the window (bottom)

    That is what I can think of unless you want to create a custom style for the progressbar as mentioned in a comment above

提交回复
热议问题