android 用代码设置margin属性,textView加粗

设置layout参数

LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); lp.setMargins(2, 2, 2, 2); view.setLayoutParams(lp);

 textview字体加粗

textView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));//加粗

textView.getPaint().setFakeBoldText(true);//加粗

你可能感兴趣的:(android,layout)