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

Change cell size and combine them with other elements? #49

Closed PerplexedFox closed 4 years ago

PerplexedFox commented 4 years ago

Hi, is there a way to change the size of dynamically sized cells? My cell width depends on its content, yet for some reason, there is an additional white space afterward. I need to get rid of it, but sadly, I could not find a way to do this. The biggest issue I have is that this resizing works seemingly at random so that many headers are cropped, while others made very wide. Do you have any idea why the cropping occurs?

Also, I would like to add some elements to the cells, like buttons or text field. Is it possible? Would appreciate your help!

Screenshot 2020-03-06 at 15 28 26

Screenshot 2020-04-02 at 19 30 34 Screenshot 2020-04-02 at 19 30 19 Screenshot 2020-04-02 at 19 32 20
pavankataria commented 4 years ago

Thank you for the screenshots. This looks unsightly and needs to be resolved. Could you upload a bare-minimum project on your github that highlights this issue so that I can test it?

pavankataria commented 4 years ago

I also noticed you changed the title from create table with defined size instead of full screen? To do this, you simply create a SwiftDataTable view and set it's size with constraints like you would do with any other UIView.

PerplexedFox commented 4 years ago

Hi, thanks for your answer.

Since I may not share my project, I created a new one with two view Controllers out of the original project where the SwitDataTables is used (there are 20+ controllers, additional functionality not relevant to this problem) but with the same data. You can find it here: https://github.com/PerplexedFox/SwiftDataTables_minEx

You will find the example of the color delegate problem I described in the other topic. About the column width: for whatever reason, it seems to decide to stop cutting (though there is still a cut column 1 see file 2). The code is 1:1 to the original project except that the data initially is not hard-coded. However, the data I used in this example project is the very same that gets passed to the table. There must be some setting where it decides where to crop😭 Is it that I use more ViewControllers, many views, etc.?

This is exactly the unpredictable behavior I meant😭

PerplexedFox commented 4 years ago

I also still have the following question:

Also, I would like to add some elements to the cells, like buttons, images or text fields. Is it possible?

pavankataria commented 4 years ago

Hi, again I just need a vanilla project that ONLY has the bare minimum code needed to reproduce the problem, this will us to focus on the isolated problem and not go on a rabbit hunt chasing other things not related to the main issue.

bakshioye commented 4 years ago

I also still have the following question:

Also, I would like to add some elements to the cells, like buttons, images or text fields. Is it possible?

Hi @PerplexedFox , Is this thing possible for this library? Or did you find some workaround. I have the same problem and I have to add buttons and images to the cells as well

pavankataria commented 4 years ago

How did you get on @PerplexedFox, we you able to get that vanilla project sorted?

PerplexedFox commented 4 years ago

I also still have the following question:

Also, I would like to add some elements to the cells, like buttons, images or text fields. Is it possible?

Hi @PerplexedFox , Is this thing possible for this library? Or did you find some workaround. I have the same problem and I have to add buttons and images to the cells as well

alas, it is not possible, or at least I could not do it. I settled on an other design, where the functionality is implemented using navigation and tab bars. Also, I used triggered actions with didSelect depending on which row and column the cell belongs. This works similarly to buttons, looks really flat though

How did you get on @PerplexedFox, we you able to get that vanilla project sorted?

I forked the library and solved it for myself, as well as added a couple of delegates for better styling. So I guess the issue can be closed now