Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to scroll tableview or scrollview in storyboard preview

I have a static tableview controller in storyboard representing a long form. I want to see the different localizations of the scene in storyboard preview, but I am not able to see the cells whose position exceeds the bounds of the actually chosen iPhone screen.

How do I make the tableview scroll in the preview window?

This question also applies to scrollviews.

(I have found similar questions, like How to scroll storyboard preview? or How to scroll UITableView in Storyboard editor of Xcode 5?, but none of them matches my specific question. There is one question that might match mine, but it's too vague to know for sure, and has no answers yet: xcode7 swift storyboard preview not able to scroll.)

like image 418
dtarnok Avatar asked Jan 13 '17 14:01

dtarnok


People also ask

How do I scroll to top Tableview?

To scroll to the top of our tableview we need to create a new IndexPath . This index path has two arguments, row and section . All we want to do is scroll to the top of the table view, therefore we pass 0 for the row argument and 0 for the section argument. UITableView has the scrollToRow method built in.

How do I create a scroll view?

In order to place multiple views in the scroll view, one needs to make a view group(like LinearLayout) as a direct child and then we can define many views inside it. A ScrollView supports Vertical scrolling only, so in order to create a horizontally scrollable view, HorizontalScrollView is used.


1 Answers

Controls that scroll must be in focus in IB before they will scroll. Click on the UITableView or UIScrollView and then scroll as you usually would.

Also, you can set the view controller's size to Freeform instead of Inferred and resize in IB so that everything is viewable.

like image 105
Jake Avatar answered Nov 15 '22 04:11

Jake