首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android页面拖拽成效

2012-08-26 
android页面拖拽效果最近看到一个画图工具有个挺不错的拖动效果,感觉挺好,想想JS中实现拖拽功能用起来也挺

android页面拖拽效果

最近看到一个画图工具有个挺不错的拖动效果,感觉挺好,想想JS中实现拖拽功能用起来也挺爽,下面简单的做了一个拖拽效果的方法,们举例给按钮做一个拖拽的效果。

?

拖拽功能事件:

?

?

注册事件

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 This is the second phase of the layout mechanism. (The first is measuring). In this phase, each parent calls layout on all of its children to position them. This is typically done using the child measurements that were stored in the measure pass().Derived classes should not override this method. Derived classes with children should override onLayout. In that method, they should call layout on each of their children.Parametersl  Left position, relative to parent t  Top position, relative to parent r  Right position, relative to parent b  Bottom position, relative to parent  

热点排行