开发者

Android XML attribute style [closed]

As it currently stands, this question is not a good fit for our Q&A 开发者_JS百科format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

Why is it that some attributes like android:layout_width is put together with an underscore? While e.g android:textColor is instead using camel-casing?

Why not stick entirely with one style (either underscore or camel-casing)?


These are not cases of different style. The second case is a simple attribute which is used by an element. The first one is an attribute which is assigned to an element, but is used by a layout. This is emphasized by the underscore-separated prefix. If you happen to look at such an attribute as android:layout_marginTop, you'll see that these two seemingly separate styles are actually parts of a single idea.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜