JRG-Developer / AutoLayoutCells

AutoLayoutCells makes working with dynamic table view cells easy.
MIT License
26 stars 4 forks source link

How to custom a autolayoutcell use code without xib #6

Closed zhuchaowe closed 9 years ago

zhuchaowe commented 9 years ago

I try to use the code to adjust the label's color ,the font, even the lineSpacing or letterSpacing which UILabel did not support .

i also use the autolayout in code but it always show one line text label, is there has any variable to set for the autolayout?

AnthonyMDev commented 9 years ago

What cell are you using? It is just the basic ALCell?

To change the font, you need to make sure that you are using the ALCellAttributedTitleKey rather than the ALCellTitleKey (and same goes for the subtitle) when setting the label text. Then you can set these values to an NSAttributedString with a set font and other attributed values.

i also use the autolayout in code but it always show one line text label, is there has any variable to set for the auto layout?

What you are trying to do here exactly is unclear to me. Would you be able to post a sample of your code?

JRG-Developer commented 9 years ago

AutoLayoutCells gives you cookie-cutter cells that will work for most instances; you can also create a new xib setting the class to ALCell, ALImageCell, etc to have a very customized cell; or you can even subclass ALBaseCell, ALCell, etc to add additional properties or behavior.

AutoLayoutCells is opinionated in that it implicitly requires that you use a xib for creating your cells. In general, it's much easier to create table view cells using Interface Builder than to do this stuff in code. If you try to create your cells in code, you'll find yourself writing a lot of sizing code and other boiler plate stuff.

I'd recommend that you see the demo project for a decent example of how use this library. If you have specific problems/questions after such, please feel free to ask. Otherwise, I'm closing this issue for now.