Group Group Group Group Group Group Group Group Group

Customised tableViewCell size

Hi,

In the SearchStore App, you customize the cell for the search result, and you explicitly set the width of the customized cell to 320. However, I run the app on Iphone SE and IPad, it seems that the customized cell is altomatically resized to fit the width of table view. Do we have to explicitly set the size of the customized cell?

@jiang Thanks very much for your question!

When it comes to UITableViewCell’s, there is the delegate method:

heightForRowAtIndexPath

but there is no such delegate method to set the width. Typically, the width of a UITableViewCell takes the width of the UITableView by default, so this is never set explicitly. Can you perhaps show the block of code where you say this happens?

This topic was automatically closed after 166 days. New replies are no longer allowed.