为什么absolutelayout是德precated?absolutelayout、precated

2023-09-07 18:13:15 作者:乱世浮生

为什么absolutelayout是德precated?我知道这可能会导致支持多种屏幕的问题,但是表示在特定位置视图更好。

why absolutelayout is deprecated? I know that it may cause problems in supporting multiple screens but was better for showing view at particular position.

推荐答案

由于绝对定位是不是在不同的屏幕分辨率和宽高比的世界太多有用的。通常你会离开被更灵活的布局来计算元素的定位。

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.

从文档:绝对布局不够灵活,更难保持比其他类型的布局没有绝对定位的

不过,如果它适合你的特殊用途,只是用它。

However, if it fits your special purpose, just use it.