Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column header text cut off on scroll #54

Open
dkawashima opened this issue May 14, 2020 · 7 comments
Open

Column header text cut off on scroll #54

dkawashima opened this issue May 14, 2020 · 7 comments

Comments

@dkawashima
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link

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
Copy link
Author

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

@pavankataria
Copy link
Owner

@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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants