Closed naushad-madakiya closed 6 years ago
@evrencoskun @sonique6784 guys any idea? I have gone through all the issues and doc but couldn't understand why this is happening
@naushad-madakiya I think row height is set with layout_height inside your row_header and cell layouts. So make sure the heigh of row_header and cell layout match.
In addition, given you layout, you should consider setting a larger RowHeader width. this can be done in your layout with layout_width, or dynamically in the code with getTableView().setRowHeaderWidth()
Hi @naushad-madakiya,
In TableView, there is no any control to checks the cell height of both of row headers and centre cells. I
So, as @sonique6784 said, you have to be sure they have the same size.
So, you have 2 options that I've just come to my mind;
android:maxLines="1"
and set much larger width. after setting up fix values for row_header_width
and column_header_height
cell width was matching to column header but cell height is not matching with row header as row header has more content than column header.
I applied the following to make cell height and width dynamic
@Override
public void onBindCellViewHolder(AbstractViewHolder holder, Object cellItemModel, int columnPosition, int rowPosition) {
// It is necessary to remeasure itself.
View columnHeaderView = columnHeaderLayoutManager.findViewByPosition(columnPosition);
View rowHeaderView = rowHeaderLayoutManager.findViewByPosition(rowPosition);
// set dynamic height and width to cell view
holder.itemView.getLayoutParams().width = columnHeaderView.getWidth();
holder.itemView.getLayoutParams().height = rowHeaderView.getHeight();
holder.itemView.requestLayout();
}
I have dynamic content for row headers where in some cases content can be longer than screen size. I saw in a sample where height & content is predefined.
1) Is there any way where cell height can be the same as row header? 2) divider for row header and column header are not visible, did I missed anything?
following is the screenshot of current UI I have implemented.