Remove a Paint Flag in Android

后端 未结 6 1509
刺人心
刺人心 2020-12-12 18:40

My code looks like this:

    TextView task_text = (TextView) view.findViewById(R.id.task_text);
    task_text.setPaintFlags( task_text.getPaintFlags() | Pain         


        
6条回答
  •  遥遥无期
    2020-12-12 19:25

    In my opinion, just set its default flag is a better choice. Otherwise, the text will be looked jagged. The default flag in TextView (EditText extends TextView) is

    Paint.ANTI_ALIAS_FLAG
    

    And set a new paintflag will replace the previous one. I have made a test to verify it. So, just like this:

    task_text.setPaintFlags(Paint.ANTI_ALIAS_FLAG);
    

提交回复
热议问题