Mhdali
Mhdali

Reputation: 688

Create UITableViewCell with greater width than its table

I have a custom UITableViewCell that its width is larger than UITableView's one (>1500px), user can scroll horizontally to show the whole cell.

I tried to set the contentSize.width of the table to match my cell's width but when I scroll the table view to the left, and when I reach a point higher than screen width, all information disappear and table become white.

Upvotes: 0

Views: 625

Answers (2)

Mhdali
Mhdali

Reputation: 688

I ended up putting the table view inside UIScrollView and set its width to match maximum UITableViewCell width, then set the content width of the UIScrollView to match this width, now I can scroll the table horizontally without any problem, thanks.

Upvotes: 1

Dani
Dani

Reputation: 1288

You simply have to use a UIScrollView inside each UITableViewCell.

Upvotes: 2

Related Questions