【发布时间】:2012-11-05 02:27:48
【问题描述】:
我有一个项目面临两个挑战:
第一:
- 将图标移动到手指触摸屏幕的任何位置:
为此,我发现的最佳方法是在视图上使用 .layout() 方法。
第二:
- 我有两个布局,在 RelativeLayout 上,都有屏幕宽度和高度(1 隐藏在另一个之后)。每次单击按钮时,我都想将上面的那个向右移动几个倾角。
有没有更好的方法在 Android 上移动视图?
使用 .layout() 方法有什么缺点?
public void layout (int l, int t, int r, int b)
Since: API Level 1
Assign a size and position to a view and all of its descendants
Parameters:
l Left position, relative to parent
t Top position, relative to parent
r Right position, relative to parent
b Bottom position, relative to parent
提前致谢。
【问题讨论】:
标签: android views android-animation