AbsoluteLayout ImageView.getLayoutParams()为x和y返回零值

时间:2011-07-13 10:47:33

标签: android layoutparams absolutelayout

在按钮点击事件中,我设置图像按钮的x和y值,点击另一个按钮后我想通过添加x = x + 10layoutParams.y之类的值再次更改其坐标0几秒前它已经设定;

            AbsoluteLayout.LayoutParams lp = new AbsoluteLayout.LayoutParams(hand.getLayoutParams());
            Log.d("mangala",String.format("b pos %d", lp.y ));
            lp.y = lp.y - g.convertDPtoPX(30f);
            Log.d("mangala",String.format("a pos %d", lp.y ));
            hand.setLayoutParams(lp);

感谢。

0 个答案:

没有答案