任何人都知道如何從Leanback ImageCardView中更改標題textcolor?Android TV Leanback imagecardview text
我試圖重寫leanback樣式,但也許我沒有找到正確的屬性。
非常感謝你!
任何人都知道如何從Leanback ImageCardView中更改標題textcolor?Android TV Leanback imagecardview text
我試圖重寫leanback樣式,但也許我沒有找到正確的屬性。
非常感謝你!
尋找在lb_image_card_view.xml正確的ID,例如這裏:https://github.com/kingargyle/adt-leanback-support/blob/master/leanback-v17/res/layout/lb_image_card_view.xml
您可以更改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);
}
你能爲你是什麼定製ImageCardView想用 CustomImageCardView擴展BaseCardView