标签: android view
view.getX()和view.getTranslationX()之间有什么不同?
答案 0 :(得分:0)
getX()定义特定视图的视觉x位置(以像素为单位)。
getTranslationX()定义特定视图相对于其左侧位置的水平位置。
有关详细信息,请参阅read here
答案 1 :(得分:0)
getX()返回视图相对于其直接父级的位置。
getTranslationX()最初返回视图相对于其左侧位置的水平平移。