为什么绝对布局被弃用?
为什么绝对布局被弃用?我知道它可能会导致支持多个屏幕的问题,但更适合在特定位置显示视图。
why absolutelayout is deprecated? I know that it may cause problems in supporting multiple screens but was better for showing view at particular position.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因为绝对定位在各种屏幕分辨率和宽高比的世界中并没有太大用处。您通常会让元素定位由更灵活的布局来计算。
来自文档:与没有绝对定位的其他类型的布局相比,绝对布局不太灵活且难以维护。
但是,如果它适合您的特殊目的,请使用它。
Because absolute positioning is not too much useful in world of various screen resolutions and aspect ratios. You'd usually leave element positioning to be computed by more flexible layouts.
From docs: Absolute layouts are less flexible and harder to maintain than other types of layouts without absolute positioning.
However, if it fits your special purpose, just use it.