在setContentView(R.layout.activity_main)之后,我想使用代码只更改textview的layout_marginTop(android:layout_centerHorizontal =" true")。
awk '
{
for (i = 1;i <= NF;i++) {
Sum[FNR,i]+=$i
Count[FNR,i]+=$i!="?|-9999|8888"
}
}
END {
for( i = 1; i <= FNR; i++){
for( j = 1; j <= NF; j++) printf "%s ", Count[i,j] != 0 ? Sum[i,j]/Count[i,j] : "?|-9999|8888"
print "-9999"
}
}
' ifile*
居中更改为左对齐。
setMargins(int left,int top,int right,int bottom)包含4个参数,但我只想更改第二个参数!
答案 0 :(得分:1)
尝试替换
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
用这个:
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams)tvcity.getLayoutParams();
答案 1 :(得分:0)
尝试使用现有的边距:
{{1}}