当前位置: 代码迷 >> 综合 >> 设置view 的MarginTop
  详细解决方案

设置view 的MarginTop

热度:15   发布时间:2024-01-21 15:59:27.0
public void setMarginTop(int top) {this.top = top;LinearLayout.LayoutParams layoutParam = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);layoutParam.setMargins(0, top, 0, 0);this.setLayoutParams(layoutParam);}

  相关解决方案