ios - With Storyboards only, how do I create a UITableViewCell that can scroll left and right using UIScrollView? -
similar mail.app can scroll cells side side, want able in app using storyboards , uiscrollview
uitableviewcell
.
i add buttons contentview
of cell, , uiscrollview
embedded uiview
on top of contain main portion of cell. add label that.
i understand scroll views in storyboard work specifying constraints show contentsize
of scroll view should be.
so position uiview
in uiscrollview
same width , height of scroll view, give trailing constraint of 50pt allow scroll view scroll. when run can move cell left reveal buttons.
but work in other direction have no idea. if add leading constraint moves cell begin away left, offsetting cell begin when should left user scroll it. works fine other being pushed over.
i created sample project showing here: http://cl.ly/2i3m1w2t0i3c
like said can't seem figure out how scroll in both directions.
try setting contentview of scrollview width higher scrollview itself. like:
assuming scrollview.frame (0,0,100,100)
[scrollview setcontentsize:cgsizemake(300,100)];
Comments
Post a Comment