什么是offsetLeftAndRight()究竟做什么? [英] What does offsetLeftAndRight() exactly do?

查看:1774
本文介绍了什么是offsetLeftAndRight()究竟做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是什么offsetLeftAndRight()究竟做什么? 文件说:由指定的像素偏移量这一观点的水平位置 那么,这是否意味着,如果视图的左侧位置是假设50和offsetLeftAndRight(20)被调用就可以了,那么该视图将被20pixels&放移动;它的左侧位置将是(50-20),即30?

What does offsetLeftAndRight() exactly do? Documentation says: "Offset this view's horizontal location by the specified amount of pixels" So, does it mean that if the view's left position is suppose 50 and offsetLeftAndRight(20) is called on it, then the view will move by 20pixels & its left position will be (50-20) i.e. 30?

在此先感谢。

推荐答案

无论是左,右位置将​​由抵消递增。所以,在你的榜样,左边的位置将变为50 + 20 = 70。

Both the left and the right positions will be incremented by the offset. So in your example, the left position will change to 50 + 20 = 70.

这篇关于什么是offsetLeftAndRight()究竟做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆