ios - Custom page view design in scroll view -
my goal
basically, want implement this: view slides each page @ bottom of screen.
my background
i'm getting familiar swift , storyboard, not knowing objective-c or nib(xib)
my attempts
- at beginning, got know enabling pagingmode of uiscrollview satisfy needs. checked scroll view programming guide ios: scrolling using paging mode provided apple. pagecontrol example pretty close, uses nib files , don't know how customise that.
- i found tutorial of [uipageviewcontroller], don't know if can resize bottom of screen.
- i searched various until found uiscrollview tutorial: getting started. covers lot , written in swift, still puts imageview contentview inside scrollview.
my questions
- how make custom view of 1 page, acts template each page data in storyboard , link stuff? (if better use nib files, references appreciated)
- how auto layout scrollview satisfy
- the scroll view takes bottom part of screen
- the labels, buttons inside content view (one page) layout properly
- if there're easier or better ways accomplish goal, please please tell me!
note sorry no more 2 links due lacking of reputations
i can answer #2:
make sure scrollview
selected. now, go editor->pin->leading space superview.
repeat bottom space superview , trailing space superview.
next, ctrl+drag scrollview
superview itself. pick equal widths.
finally, select constraint left clicking storyboard, or selecting scrollview
, selecting size inspector.
change constant value of constraint 0. change multiplier 0.5. make sure first item scrollview, , if not, click drop down box , reverse first , second item.
that give scrollview
want: 0.5 times height of superview (half of screen).
Comments
Post a Comment