SuperTextView icon indicating copy to clipboard operation
SuperTextView copied to clipboard

空心字设置了无效果

Open XuMengren opened this issue 1 year ago • 2 comments

implementation 'com.github.chenBingX:SuperTextView:v3.2.6.99'

<com.coorchice.library.SuperTextView android:id="@+id/tv_sort" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="2dp" android:ellipsize="end" android:maxLines="1" android:singleLine="true" android:textSize="12sp" android:gravity="center" android:textStyle="bold" android:layout_gravity="center" app:stv_text_stroke="true" app:stv_text_fill_color="#FFF8CB" app:stv_text_stroke_color="#222222" app:stv_text_stroke_width="1dp" android:text="添加新分类" />

image

我没有设置字体颜色,为什么他会是白色的

XuMengren avatar Aug 23 '24 01:08 XuMengren

image 在项目中预览又是正常的

XuMengren avatar Aug 23 '24 01:08 XuMengren

targetSdk设置为29及以上,会导致下面的代码发生异常,导致失效

private void setTextColorNoInvalidate(int color) { Field textColorField; try { textColorField = TextView.class.getDeclaredField("mCurTextColor"); textColorField.setAccessible(true); textColorField.set(this, color); textColorField.setAccessible(false); } catch (Exception e) { e.printStackTrace(); } }

vince-cooper avatar Mar 28 '25 04:03 vince-cooper