gravity start left 區別

原文地址 


原文如下:
#AndroidDev   #Protip  — use gravities of START and END instead of LEFT and RIGHT for better RTL support. Although the constants are only defined in API 14 [0], they are backward compatible because (1) they're inlined at compile time and (2) they're functionally equivalent to LEFT and RIGHT on earlier devices because of their least-significant bytes:


START = 0x00800003
LEFT = 0x00000003
END = 0x00800005
RIGHT = 0x00000005


Edit: You can see the difference between START and LEFT with <TextView layout_width=match_parent, gravity=start, text=[hebrew characters here]> … the text layout will see your Hebrew characters and align text to the right boundary of the TextView instead of the left because of gravity=start. And note, the default horizontal gravity of TextView is start, not left.


So, left is always left and right is always right, but start and end can be either left or right, depending on the locale.


個人總結:

left是絕對的左邊,start會根據不同的國家習慣改變。

比如在從右向左順序閱讀的國家,start代表的就是在右邊
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章