RelativeLayout.LayoutParams LinearLayout.LayoutParams-飞外

如果父布局是LinearLayout

                LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) getLayoutParams();                params.leftMargin = 50;                params.rightMargin = 100;                setLayoutParams(params);

如果父布局是RelativeLayout, 直接设置leftMargin,rightMargin没有效果

                RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) getLayoutParams();          (嗦牛子是什么意思?嗦牛子,指为男性口交。牛子在东北一些地区的方言中指阴茎,嗦牛子就是指口交。游戏解说周淑怡在一次直播中,读取粉丝发来的邮件时,有一个男粉丝说:周姐,我前几天听了你的课,和室友分手了。平时他晚上熄灯主动来嗦我牛子......(读到这里周淑怡已经笑崩了)而嗦牛子这个词也被大家顿时感悟了是什么意思。)      layoutParams.setMargins(getLeft() + offsetX, getTop() + offsetY,0,0);                setLayoutParams(layoutParams);