TableView
TableView copied to clipboard
Corner View not shown
This is my xml file
`<com.evrencoskun.tableview.TableView
android:id="@+id/tableView"
android:layout_below="@id/rel"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:row_header_width="@dimen/_80sdp"
app:column_header_height="@dimen/_30sdp"
app:selected_color="@color/white"
app:shadow_color="@color/white"
app:allow_click_inside_cell="true"
app:allow_click_inside_row_header="true"
app:allow_click_inside_column_header="true"
app:unselected_color="@color/white"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>`
My corner view
` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="@dimen/_80sdp" android:layout_height="@dimen/_40sdp" android:orientation="vertical" android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="States/UT"
android:textSize="@dimen/_12ssp"
android:padding="@dimen/_5sdp"
android:textColor="@color/black"/>
</LinearLayout>`
i have returned this view from method onCreateCornerView()
same problem to me
@juanlabrador @aashitshah26 There's a bug in the library. If you use methods for separate columns, rows & cells setting instead of setAllItems() - corner view is not added to the layout. I had to fix it for myself manually in the code. So for now there are 3 options:
- Wait for the fix
- Add the library as a module to your project and fix the problem manually (add code with the corner view adding to the container FrameLayout)
- Use setAllItems() method
Corner View is currently not shown if any of the column or row headers or cells have no data.
In my case I have column headings but no data for the rows (cells and row headings)> This produces an odd view of:-
I think it a fairly normal case if your have column headings you would want to display the corner view (which is a column heading of the row headings)
If you have zero column heading, zero row heading and zero data then you would expect no corner view as well.
As this is a change in behaviour I feel that this should be optional not to break people who expect the existing behaviour.
I have a change prepared to optionally produced:-
Once I have fully tested it I'll make a pull request for this.
I faced this problem and I found the easiest solution is calling getCornerView() and update view visibility after calling setAllItems() method getCornerView().visibility = View.VISIBLE
@Mohamadkotb no, not works for me. I have to added empty row to end table for showing corner. Thanks @Zardozz
This should be able to be closed with the release of 0.8.9.4
You can now call setShowCornerView(true)
on the tableView before you set the adapter, so that the cornerview is drawn even if you don't have any row headers (and rows)
Results as per comment https://github.com/evrencoskun/TableView/issues/308#issuecomment-651248087