急,如何获取桌面图标的位置 想做一个动态桌面,需要知道图标在桌面上的坐标,请各位大侠出招,谢谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 资料:Android Launcher中取得桌面所有图标的左上角坐标Java代码 /** * 取得所有桌面图标的左上角坐标值 * @ author: 叶里的猫 *@return 返回坐标数组 */ public int [][] getAllChildCoordinate(){ int size = this.getChildCount() ; int [][] coordinates = new int [size][2]; for(int i=0;i< p> View child = this.getChildAt(i); if(child instanceof BubbleTextView){ BubbleTextView btv = (BubbleTextView)child ; //横坐标 int left = btv.getLeft() ; //纵坐标 int top = btv.getTop() ; coordinates[i][0] = left ; coordinates[i][1] = top ; } } return coordinates ; } /** * 取得所有桌面图标的左上角坐标值 * @ author: 叶里的猫 *@return 返回坐标数组 */ public int [][] getAllChildCoordinate(){ int size = this.getChildCount() ; int [][] coordinates = new int [size][2]; for(int i=0;i< p> View child = this.getChildAt(i); if(child instanceof BubbleTextView){ BubbleTextView btv = (BubbleTextView)child ; //横坐标 int left = btv.getLeft() ; //纵坐标 int top = btv.getTop() ; coordinates[i][0] = left ; coordinates[i][1] = top ; } } return coordinates ; } iscroll插件左右滑动问题 NDK里打开/dev/graphics/fb0问题 android 4.0 的系统 options menu 与 android 2.3 不一样 TextView触发方法,在线等 模拟器安装问题 GridView 可以跨列么?类似于课程格子的主界面 android showdialog废弃问题 想在android 3.0以下版本实现search widget样式的搜索框,有什么办法没? 本人菜鸟想学android app开发,遇到点问题,求高手教 安卓 急:android动画 如何绕Y轴旋转,求代码 从后台唤醒onRestart的疑问
/**
* 取得所有桌面图标的左上角坐标值
* @ author: 叶里的猫
*@return 返回坐标数组
*/
public int [][] getAllChildCoordinate(){
int size = this.getChildCount() ;
int [][] coordinates = new int [size][2];
for(int i=0;i< p>
View child = this.getChildAt(i);
if(child instanceof BubbleTextView){
BubbleTextView btv = (BubbleTextView)child ;
//横坐标
int left = btv.getLeft() ;
//纵坐标
int top = btv.getTop() ;
coordinates[i][0] = left ;
coordinates[i][1] = top ;
}
}
return coordinates ;
}
/**
* 取得所有桌面图标的左上角坐标值
* @ author: 叶里的猫
*@return 返回坐标数组
*/
public int [][] getAllChildCoordinate(){
int size = this.getChildCount() ;
int [][] coordinates = new int [size][2];
for(int i=0;i< p>
View child = this.getChildAt(i);
if(child instanceof BubbleTextView){
BubbleTextView btv = (BubbleTextView)child ;
//横坐标
int left = btv.getLeft() ;
//纵坐标
int top = btv.getTop() ;
coordinates[i][0] = left ;
coordinates[i][1] = top ;
}
}
return coordinates ;
}