pavankataria / SwiftDataTables

A Swift Data Table package, display grid-like data sets in a nicely formatted table for iOS. Subclassing UICollectionView that allows ordering, and searching with extensible options.
MIT License
448 stars 69 forks source link

Column header text cut off on scroll #54

Open dkawashima opened 4 years ago

dkawashima commented 4 years ago

iOS 11, most recent SwiftDataTables update.

When I create a table and scroll outside of the initial view, a lot of the header titles get shortened to the point where you cannot tell what the title is.

If all of the headers are visible without having to scroll left, then it works perfectly. But if the datatable is too big to fit without scrolling, I see something like this.

I couldn't find a parameter to change this other than fixed column widths, which shouldn't be necessary here. IMG_1849

pavankataria commented 4 years ago

Okay, I can't reproduce this my end. Could you create a vanilla xcode project so I can check it out please? Aka the bare minimum required to reproduce this please.

I can then take a look at this and see what's going on.

dkawashima commented 4 years ago

Cool, thanks! working on getting a vanilla Xcode project. For more info, I've noticed this is only an issue if the value in the column itself is an integer. For strings, it works fine.

pavankataria commented 4 years ago

Hi @dkawashima , cheers for the debugging. I look forward to receiving your vanilla project.

In the mean time I've just upgraded to Catalina and I'm experiencing a wealth of development problems. Xcode keeps crashing and taking me the login screen where I'm then locked out until I restart. Lol, rebooting in safe mode things work well so all hope is not lost. It would have been better had I downloaded the latest xcode 11 version that works on Mojave.

Just informing you all that things might be slow for me in regards to SwiftDataTables work so I appreciate the effort some of you guys have been putting in to make this package more awesome.

PerplexedFox commented 4 years ago

iOS 11, most recent SwiftDataTables update.

When I create a table and scroll outside of the initial view, a lot of the header titles get shortened to the point where you cannot tell what the title is.

If all of the headers are visible without having to scroll left, then it works perfectly. But if the datatable is too big to fit without scrolling, I see something like this.

I couldn't find a parameter to change this other than fixed column widths, which shouldn't be necessary here. IMG_1849

@dkawashima, had this problem. You need to change the column width calculation, which is currently quite rough. It works with strings because they are usually wider, which means the "average" width is greater.

dkawashima commented 4 years ago

@PerplexedFox do you mean manually changing the column width calculations, for each header?

pavankataria commented 4 years ago

@dkawashima @PerplexedFox how would you guys prefer this to be calculated? I'm thinking of making it so that the user specifies a hardcoded width for each of the columns which will by default propagate to the header and items width.

What do you think? I'm considering removing the auto calculation especially since it relies on the data being textual. And iterating through every item in the datasource just to compute the average width for the column seems wasteful.

dkawashima commented 4 years ago

yeah i think that makes sense (hardcoded width). otherwise could make sure text doesn't get cut off or resizes to fit current width as Apple typically does with a UILabel. like hardcoded width though