开发者

Need to dynamically relocate the position of an image

Is it possible to do so? A workaround would be to put in two copies of the same image at the starting place and the ending place with the visibility of the first set to visible and the end position to invisible and swap their visibiliti开发者_开发问答es dynamically on button click. That would work. But is there any in-built function that would actually enable me to relocate the image? thanks and cheers !


Well you could change the layout parameters for the imageview

Like

 LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
        LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
 lp.topMargin = 10;

 imageview.setLayoutParams(lp);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜