今天在查看Astrid源碼的時候發現了界面佈局中Gravity和Visible的新用法,簡要記錄一下。html
Gravity: API 文檔記錄android
int | CENTER | Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. |
int | CENTER_HORIZONTAL | Place object in the horizontal center of its container, not changing its size. |
int | CENTER_VERTICAL | Place object in the vertical center of its container, not changing its size. |
這個頗有意思。佈局
Constant | Value | Description |
visible | 0 | Visible on screen; the default value.spa |
invisible | 1 | Not displayed, but taken into account during layout (space is left for it). |
gone | 2 | Completely hidden, as if the view had not been added..net |
注意invisible與gone的區別。htm
下面用圖演示一下:ip
注意看下面的稍後:ci
1:visible文檔
2:invisibleget
「稍後」那個地方空白了
3:gone
這樣是否是清楚一點:
visible | invisible | gone |