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 454 forks source link

Cell Width resize issue. #320

Closed shiva-kumar-R closed 4 years ago

utsavdotpro commented 3 years ago

Was the width of your table changing terribly on scroll? If yes, did you find the solution?

ReejeshPK commented 2 years ago

If you look inside the CellViewHolder in the sample app, you will find these two lines :

// It is necessary to remeasure itself.

        cell_container.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
        cell_textview.requestLayout();

Putting these lines inside the onBindCellViewHolder, onBindColumnHeaderViewHolder helped solve the issue.

_cellcontainer is the parent layout of your cell.

I kind of put it in all onBind

Here is the file : https://github.com/evrencoskun/TableView/blob/master/app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/CellViewHolder.java

IlhamHadisyahRamadhani commented 10 months ago

still having this issue after added cellContainerView.layoutParams.width = xxx cellCcontainerView.requestLayout().

and

headerContainerView.layoutParams.width = xxx headerCcontainerView.requestLayout().

all of these located on onBindCellViewHolderand onBindColumnHeaderViewHolder

condition :

issue :