I mean why anybody want they view to be 0dip height ? I have seen this many times, there must be some kind of trick, but I do not get it.
This is heavily used for views withing LinearLayout. There are three "layout" attributes that LinearLayout is aware of:
android:layout_heightandroid:layout_widthandroid:layout_weightYou can find example with android:layout_weight in tutorial project.
So when android:layout_weight is used on View X and LinearLayout is horizontal, then X's android:layout_width is simply ignored.
Similar, when android:layout_weight is used on View X and LinearLayout is vertical, then X's android:layout_height is ignored.
This actually means, that you can put anything in those ignored fields: 0dp or fill_parent or wrap_content. It doesn't matter. But it's recommended to use 0dp so View's do not do extra calculation of their height or width (which is then ignored). This small trick simply saves CPU cycles.