原文地址
原文如下:
#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代表的就是在右边
gravity start left 区别
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
innerText,outerText,innerHTML,outerHTML
zhaoxiaoyang5156
2020-02-22 10:38:30
C# 中的委托和事件
zhaoxiaoyang5156
2020-02-22 10:38:30
VS.net IDE中,使用正则表达式进行查找、替换
zhaoxiaoyang5156
2020-02-22 10:38:20
在论坛看到的一个反射的例子
明明就可以
2018-08-29 04:36:47
到底什么是产品经理--活着就是为了改变世界,生命才有意义。
newlife615
2018-08-28 00:40:11
很好的thymeleaf模板 入门例子
f0rd_
2018-08-22 16:54:20
MYSQL性能优化的最佳20+条经验
f0rd_
2018-08-22 16:54:03
Mybatis中的 ${ } 和 #{ }的区别
f0rd_
2018-08-22 16:54:03
HttpServletRequest 各种方法总结
f0rd_
2018-08-22 16:54:01