Android TV Leanback imagecardview文字颜色
作者:互联网
有人知道如何从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);
}
标签:android,leanback 来源: https://codeday.me/bug/20190824/1712314.html