开发者

Why does margin override marginLeft in Android (same with radius, etc)?

开发者 https://www.devze.com 2023-01-24 06:18 出处:网络
This makes no sense to me, coming from CSS. In CSS, if you specify a margin and then ma开发者_开发知识库rgin-left, the left margin will assume the more granular value.

This makes no sense to me, coming from CSS. In CSS, if you specify a margin and then ma开发者_开发知识库rgin-left, the left margin will assume the more granular value.

In Android, it is the opposite. Same goes for android:radius, and I'm sure other values.

My question is: why?.. It makes no sense. Is there a single reason for doing it this way?

Edit: prompted by trying to find a solution to yet another Google ADT/Android bug http://code.google.com/p/android/issues/detail?id=7588


I have had the same frustration, but if you think about it, which value should be used? I know in your post you say that CSS uses the "more granular value" but it all boils down to pixels in the end and the result is simply two pixel values that need to be chosen between. The CSS standard chose to do it one way, Android chose the other, I don't think either approach is wrong, they are just different.

0

精彩评论

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