TextView

android textview 添加下划线 中划线 删除线

tv=(TextView)findViewById(R.id.tvId);
  tv.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG); //删除线

//Paint.UNDERLINE_TEXT_FLAG 下划线 可以测试其他的自己

从数组中删除元素的方法(TextView.class 4945行),用了修改Drawable的state。

            final int length = drawableState.length;

            for (int i = 0; i < length; i++) {

                if (drawableState[i] == R.attr.state_pressed) {

                    final int[] nonPressedState = new int[length - 1];

                    System.arraycopy(drawableState, 0, nonPressedState, 0, i);

                    System.arraycopy(drawableState, i + 1, nonPressedState, i, length - i - 1);

                    return nonPressedState;

                }

            }

原文地址:https://www.cnblogs.com/huiyh/p/3558183.html