谁知道我该如何从Leanback ImageCardView更改标题textcolor?
我试图覆盖leanback样式,但是也许我没有找到正确的属性。
非常感谢!!!
您可以按以下方式更改ImageCardView的文本颜色:
// I'm assuming you're creating your ImageCardView within a Presenter
@Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup) {
final Context context = viewGroup.getContext();
final ImageCardView imageCardView = new ImageCardView(context);
imageCardView.setFocusable(true);
imageCardView.setFocusableInTouchMode(true);
((TextView) imageCardView.findViewById(R.id.title_text)).setTextColor(TITLE_COLOR); // Title text
((TextView) imageCardView.findViewById(R.id.content_text)).setTextColor(DESCRIPTION_COLOR); // Description text
return new ViewHolder(imageCardView);
}
Run Code Online (Sandbox Code Playgroud)