【发布时间】:2019-04-10 13:47:53
【问题描述】:
@Override
protected void onBindViewHolder(@NonNull final Chat.MessagesViewHolder holder, final int position, @NonNull final MessagesHelper model) {
holder.mDisplayText.setBackgroundColor(BackgoundColorSent);
}
我可以为 textColor 和 size 做到这一点,但没有 textStyle 的方法。我正在使用firebaseRecyclerAdapter 并希望根据用户的喜好以编程方式更改recyclerView 项目的style。
【问题讨论】:
-
sse
TextView#setTextAppearance -
setTextAppearence() 括号内应该有什么......就像我只想要 3 种样式粗斜体和粗斜体 @pskink
-
那为什么不使用
textView.setTypeface(Typeface.DEFAULT_BOLD); -
@MichelleKinsten 试试这个..
textView.setTextAppearance(getActivity(), R.style.fontForNotificationLandingPage);
标签: java android xml android-studio styles