首页 > 移动平台 > 详细

【android】代码改变ImageButton的位置

时间:2016-02-13 18:16:39      阅读:200      评论:0      收藏:0      [点我收藏+]
public static void setLayout(View view,int x,int y)
{
ViewGroup.MarginLayoutParams margin=new ViewGroup.MarginLayoutParams(view.getLayoutParams());
//margin.setMargins(x,y, x+margin.width, y+margin.height);
Log.d("xy",""+margin.width+" "+margin.height);
margin.setMargins(x,y, 0, 0);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(margin);
view.setLayoutParams(layoutParams);
}

【android】代码改变ImageButton的位置

原文:http://www.cnblogs.com/Thkeer/p/5188071.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!