superuser
superuser

Reputation: 455

How to customize the UITableView scrolling in horizontal direction?

I have a requirement to show the table view in horizontal scrolling.

Eg: In 1st page have to show 10 rows, while scrolling (Horizontal) to the 2nd page have to show 10 more rows, like that I have to show.

How can it be possible?

Upvotes: 1

Views: 1739

Answers (4)

kamran dehghan
kamran dehghan

Reputation: 3

How about implementing UiTableView inside a superior UICollectionView cells? I think there is already a topic for my solution here

Upvotes: 0

Danilo Campos
Danilo Campos

Reputation: 6479

Picked this up from an Apple engineer at WWDC: Try setting the tableview's transform to rotate it 90 degrees. Let's see, I think it'd be something like:

Objective-C

self.tableView.transform = CGAffineTransformMakeRotation(90.0 * M_PI / 180); //Convert 90 degrees to radians

Swift 4+

self.tableView.transform = CGAffineTransform(rotationAngle: 90.0 * .pi / 180) //Convert 90 degrees to radians

You'll get all the easy view recycling of a tableview, just horizontally. If subviews of each cell need to be oriented normally, just apply a corresponding rotation transform on those in a UITableViewCell subclass.

Upvotes: 2

jtbandes
jtbandes

Reputation: 118761

Use a UIScrollView and turn on pagingEnabled. Then put a UITableView on each page.

Upvotes: 4

Gypsa
Gypsa

Reputation: 11314

What you can do to have scrolling horizontally in table view is. Add scrollers to your table view rows and set contents size with increasing width and fixed height.

Upvotes: 0

Related Questions