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

Allow text to wrap up to the next line #36

Open
hamzabinamin opened this issue Jun 28, 2019 · 8 comments
Open

Allow text to wrap up to the next line #36

hamzabinamin opened this issue Jun 28, 2019 · 8 comments

Comments

@hamzabinamin
Copy link

Would be really helpful to wrap longer text on to the next line instead of making the font smaller.

@hamzabinamin
Copy link
Author

hamzabinamin commented Jul 8, 2019

@pavankataria did you get a chance to take a look at this?

@pavankataria
Copy link
Owner

pavankataria commented Jul 31, 2019

Hi @hamzabinamin, yes, this is again related to autolayout and it's not something I've tried to resolve just yet since it's quite complicated having had to create auto calculating cell heights in collection views. In the past I resorted to using what I believe is called a self sizing class but it got ugly in terms of coding and doesn't fair well when there's varying types of cells.

I have a hard time figuring out how I'm going to resolve this as this requires the autolayout engine to calculate what the height of the cell will need to be and I'm not sure how to achieve this the correct way.

I'd be very interested to have someone explore this issue further and finding out potential ways to resolve automatic height calculation with autolayout.
I'd also be interested in a one for all solution but also for an interim solution that doesn't require the use of self sizing cell classes.

@hamzabinamin
Copy link
Author

@pavankataria Its been a while, hope you're doing okay!

Has there been any update regarding this feature?

@pavankataria
Copy link
Owner

pavankataria commented Jun 18, 2020

Hi @hamzabinamin I'm afraid until an elegant solution hasn't been found I can't implement it. I don't want to explore hacky options as there needs to be a long term solution. I'll need some help in this regard but waiting for the right individual to come along who has experience in creating custom UICollectionView layouts which works well with Autolayout. It's actually harder than it seems.
Sorry for now.

@pavankataria
Copy link
Owner

I am working on this, as you can see in this prototype I'm working on you can see cells self size just fine, the issue is that the other cells don't expand their height which would look visually more appealing.
image

@hamzabinamin
Copy link
Author

hamzabinamin commented Jun 28, 2020

@pavankataria Before populating the cells, can't we calculate the max number of lines a value can utilize and update the table view row height for all cells?

@pavankataria
Copy link
Owner

It's hacky and only sort of works for this scenario, it's not a scalable solution. Imagine cells that can have any kind of view which doesn't depend on textfields. For example a button, or an image etc, they should also self size.
The behaviour we want is that the cells in the same row should resize to the tallest cell after the autolayout engine has calculated the heights of all the cells in the row.

I'm still working on a solution. It may take a while but I'm working on a viable solution.

@hamzabinamin
Copy link
Author

@pavankataria Were you able to figure out something?

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

No branches or pull requests

2 participants