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

Change font? #39

Open
makslevental opened this issue Jul 30, 2019 · 8 comments
Open

Change font? #39

makslevental opened this issue Jul 30, 2019 · 8 comments

Comments

@makslevental
Copy link

Is there a way to change the fonts without messing with the xibs?

@altagir
Copy link

altagir commented Jul 30, 2019

by using apperances

@makslevental
Copy link
Author

@altagir what does this mean?

@pavankataria
Copy link
Owner

pavankataria commented Jul 31, 2019

Yeah so you can either use either the UIAppearance class as altagir mentioned though I do think there's a strong case to allow the user to provide their own custom view and this could solve so many appearance related requests.

I just don't know the best way to deal with resizing since the data table currently manually resizes each row. I just haven't thought about how this would work in relation to laying out the custom views rows and populating the row itself since it's a custom one..

It's a case of deciding who is going to be responsible for populating the row. You could argue if you provide a custom view then the library won't pass in the data itself and that it's up to the user to do that.

Any thoughts?

@madhavajay
Copy link
Contributor

It's a real pity, I was trying to use this but unfortunately the inability to change fonts and font sizes and control if the font text wraps or gets shrunk made this unusable. So plus +1 to having more control over the text in each cell.

@pavankataria
Copy link
Owner

Was hoping this would generate some noise but it's been relatively quiet. I'm hoping there's a clean way to allow text wrapping of cells in SwiftDataTable. This does require working out the height of each cell. If this is possible using the Autolayout engine to determine the size that would be best.

@altagir
Copy link

altagir commented Nov 5, 2019

custom cell with automatic dimension tableview.rowheight = UITableViewAutomaticDimensionn

then use autolayout in a custom UITableViewCell to constraint height

ideally SwiftDataTable should provide a setter to set a custom nib

@pavankataria
Copy link
Owner

So I'm not using tableviews here, and SwiftDataTables uses collection views with fixed heights defined. Using auto layout engine to determine the sizes of each row is the ideal scenario.
Though while scrolling, as you don't want to calculate sizes of all the rows since they're not all presented.

I think the first step is to allow custom cells, though the issue still remains, these custom views will be squashed to the cell attributes defined by SwiftDataTables. What people want are word wrapped cells that automatically resize and take the necessary height, and to apply that height to the reset of the cells in that row.

If anyone wants to take a stab at implementing autolayout self resizing cells that would be good.

@PerplexedFox
Copy link

PerplexedFox commented Apr 9, 2020

Hi, @pavankataria so I would like to be able to change the font size of the cells and headers, but keeping other SwiftDataTable-unrelated labels as they were. What is the best way to do it?

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

5 participants