frameLayout代替AbsoluteLayout通过坐标定位
貌似iteye人越来越少了,算了我还是在这里记录一下吧。
你是我的眼,带我阅读浩瀚的书海·········
..........
假如我定义一个需要定位的imageView
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);layoutParams.gravity = Gravity.LEFT|Gravity.TOP;layoutParams.leftMargin = x;layoutParams.topMargin = y;imageView.setLayoutParams(layoutParams);