Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经以编程方式创建了 Progressbar,现在当在 linearlayout 中可见时,如何将它保持在屏幕的中心和其他视图的顶部?
考虑使用 aRelativeLayout而不是 theLinearLayout并向您的ProgressBar: centerInParent= true 添加属性。
RelativeLayout
LinearLayout
ProgressBar
centerInParent
覆盖另一个视图下的视图只能在RelativeLayout(或FrameLayout,但更棘手)中完成
FrameLayout