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.
为什么absolutelayout被弃用了?我知道它可能会导致支持多个屏幕的问题,但更适合在特定位置显示视图。
因为绝对定位在各种屏幕分辨率和纵横比的世界中并没有太大用处。您通常会让元素定位由更灵活的布局来计算。
来自文档:与没有绝对定位的其他类型的布局相比,绝对布局更不灵活且更难维护。
但是,如果它适合您的特殊用途,请使用它。