SmartRefreshLayout 设置刷新文字颜色,有问题,不能更改文字颜色

pkbketx9  于 2个月前  发布在  其他
关注(0)|答案(2)|浏览(43)

<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srlAccentColor="@android:color/white">

<com.scwang.smartrefresh.layout.header.ClassicsHeader
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/msg_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="none" />

    <com.scwang.smartrefresh.layout.footer.ClassicsFooter
        android:id="@+id/footer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:srlAccentColor="@android:color/white"
        app:srlClassicsSpinnerStyle="Translate" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>

我想吧刷新的文字颜色改成白色。。。但是Footer的颜色死都改不了。
ClassicsFooter footer = findViewById(R.id.footer);
TextView tv = footer.findViewById(ClassicsFooter.ID_TEXT_TITLE);
ToastUtil.showMsgToast(tv.getText().toString());
tv.setTextColor(Color.parseColor("#ffffff"));
我尝试直接拿到textView去改,也改不了。。。我真的无语了,一个鸡儿两个大。。。

tktrz96b

tktrz96b1#

我是设置多行显示文本也不行,,
TextView tv =mainRefresh.findViewById(ClassicsFooter.ID_TEXT_TITLE);
tv.setSingleLine(false);
tv.setMaxLines(2);
tv.setGravity(Gravity.CENTER);
tv.setEllipsize(TextUtils.TruncateAt.END);
不过你这个问题可以通过设置主题颜色来解决

i2loujxw

i2loujxw2#

我也遇到这个问题

相关问题