evrencoskun / TableView

TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
MIT License
3.14k stars 459 forks source link

cell color not set #335

Closed umeshkanhasoft closed 4 years ago

umeshkanhasoft commented 4 years ago

@Override public void onBindCellViewHolder(@NonNull AbstractViewHolder holder, @Nullable Cell cellItemModel, int columnPosition, int rowPosition) { ((CellViewHolder) holder).cellData.setText(((Cell) cellItemModel).getData()); ((CellViewHolder) holder).setBackgroundColor(ContextCompat.getColor(context,R.color.colorAccent)); }

ashish-d-hh commented 4 years ago

Hi @umeshkanhasoft I was able to change background color of my header using:


Inside onBindColumnHeaderViewHolder
try {
columnHeaderViewHolder.itemView.getBackground().setColorFilter(Color.parseColor(columnHeaderItemModel.getColor()), PorterDuff.Mode.DARKEN);
 } catch (Exception e) {
 e.printStackTrace();
}
umeshkanhasoft commented 4 years ago

thanks