0

Possible Duplicate:
Horizontal UITableView
Horizontal scrolling UITableView

Can we scroll a tableview horizontally in iphone? I have a tableview with four columns. Can I scroll it horizontally to show the values? Thanks in advance

Community
  • 1
  • 1
user1001011
  • 41
  • 3
  • 8

3 Answers3

1

See this example

https://github.com/alekseyn/EasyTableView

Minakshi
  • 1,437
  • 1
  • 11
  • 19
0

I think you want to display text in detail. The same case with me. I tried 2 options. One to add a UIScroll view and add UITable view inside it. But it doesnot work. Then I use custom cell and add Ui scroll in cell. It works but I think it is against HIG of Apple.

So at last I tried the last option which works for me. I have added line break mode for Cell's text to divide it in 2 or 3 lines to display the full text in cell. here is the sample code in The Cell for Row at Index Path method while creating the cell when it is nill means at the time of creation. Try this , I hope it will help you.

    if (cell == nil) 
    {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;
        cell.textLabel.numberOfLines =0;
        cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:15.0];
    }
Sublime
  • 198
  • 4
  • 13
  • Under Xcode 7 and iOS 8/9, I was able to add a `UITableView` inside a `UIScrollView` and have horizontal scrolling take place. You basically have the tableview be the width of its cells and the height of all of them combined, add it to a scrollview whose frame is smaller than the tableview, and make the scrollview's `contentSize` property the size of the tableview's frame. This will allow the scrollview to scroll. You also have to play around with some of the `bounces` settings and possibly disable the VC's `automaticallyDisablesScrollViewInsets`and adjust the `contentInset` property. – Evan R Mar 29 '16 at 14:29
0

After a quick Google search I came up with a result. Check this thread out and the answers within it to see if you find it helpful, but it appears to be the exact same question you are asking here.

Horizontal UITableView

Community
  • 1
  • 1
Brayden
  • 1,795
  • 14
  • 20