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

    技术2022-05-19  26

    设置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);//加粗


    最新回复(0)