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?
-
1u can do it using scroll view ! add scr0ll view and then add your table view asa subView to your scroll view !! – Deepjyoti Roy Oct 10 '12 at 06:23
-
you should use GridView for vertical & Horizontal scroll – Romit M. Oct 10 '12 at 12:39
3 Answers
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.
- 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
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.
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
- 17,837
- 1
- 55
- 65
- 101
- 9