我的代码如下:
RemindView remindView = new RemindView(this);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.gravity = Gravity.TOP;
layoutParams.topMargin = ViewUtils.getViewHeight(view);
addContentView(remindView, layoutParams);
但禁用了边距属性,即layoutParams.topMargin
。我想知道这个问题的原因。请帮忙。