2

I want to create a table view with both horizontal and vertical scrolling. The content in each row will be label with text. The horizontal scrolling should there when the label size increases the width of the table view. (ie, I dont want to show label's text like "abcdefg...") Is it possible?

Dev
  • 3,885
  • 10
  • 39
  • 65

3 Answers3

2

Set the UIScrollView contentSize property through code and make sure that UIScrollView contentSize property will have the same height but it would have a greater width than tableView.

OR

You can use an UIScrollView and then inside add the UITableView. This UIScrollView will have the same size that your UITableView have now, but the UIScrollView contentSize property will have the same height but it would have a greater width.

IronManGill
  • 7,222
  • 2
  • 31
  • 52
  • Yeah, now i added my tableview inside the scrollView. But i want to set this scrollview content size dynamically according to the label size inside the row in the tableview. How can I do this? – Dev Oct 10 '12 at 06:50
  • Checkout this link :) http://stackoverflow.com/questions/11902223/uiscrollview-dynamically-resize-uilabel – IronManGill Oct 10 '12 at 06:54
  • Also this one - http://stackoverflow.com/questions/12470653/monotouch-uiscrollview-not-scrolling-with-dyanmic-uilabel-height – IronManGill Oct 10 '12 at 06:55
0

You can use an UIScrollView and then inside add the UITableView. This UIScrollView will have the same size that your UITableView have now, but the UIScrollView contentSize property will have the same height but it would have a greater width.

see UITableView scroll both vertically and horizontally

and https://github.com/alekseyn/EasyTableView

Community
  • 1
  • 1
Venk
  • 5,949
  • 9
  • 41
  • 52
0

use the following may it work for u.....

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation==UIInterfaceOrientationLandscapeLeft ||   interfaceOrientation== UIInterfaceOrientationPortrait);
}

also make changes in inteface builder to adjust size and width

Nekto
  • 17,837
  • 1
  • 55
  • 65