+-
Android的盒子模型
令我感到惊讶的是,我还没有找到有关 Android盒子模型的详细信息.我的意思是,填充,边距,重力等如何相互影响.

除了开发站点中的note about margin and padding和SO question之外,这里没有太多信息.

我在寻找什么:

>边距,填充,重力等的默认设置是什么?
>制造商是否可以更改这些默认设置.如果是这样,忽略这些默认值是一个好习惯,这样您的应用程序在不同的制造商之间看起来是一致的吗?
>如何解决冲突,尤其是组件及其子组件之间的冲突.
> Android版本之间有何不同?

真的那么简单,不值得在文档中进行更深入的解释吗?

谢谢,

胡安

最佳答案

Rather surprised that I haven’t been able to found detailed information about Android’s box model.

请注意,您的问题很少与LinearLayout有关,LinearLayout是Android的XUL或Flex中的“盒子模型”.也许您对“盒子模型”的定义与我使用的定义不同.

What are the defaults for margins, paddings, gravities, etc.

默认边距和填充为0像素.默认重力因小部件/容器而异.

Can manufacturers alter those defaults.

从技术上讲,是的,尽管我不知道这是在实践中完成的.

How are conflicts resolved, specially between a component and its children.

在边距,填充或重力方面没有可能的冲突.

Any difference between Android versions?

不是我知道的.

Is it really that simple that is not worth a deeper explanation in the docs?

恕我直言,是的.

点击查看更多相关文章

转载注明原文:Android的盒子模型 - 乐贴网