在代码里设置view的android:layout_marginTop

LinearLayout.LayoutParams layoutParam = new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
    layoutParam.setMargins(0, -5, 0, 0);
    ll.setLayoutParams(layoutParam);

你可能感兴趣的:(在代码里设置view的android:layout_marginTop)