uiscrollview - iOS fixed width ScrollView -
i want achieve following auto layout.
--------------------- | | | | | | | scrollview | | | | | | | | | --------------------- | | | content | | | ---------------------
the scrollview
has width equal screen size , content inside scrollview
extends screen. not want user able scroll horizontally.
i have tried
put
view
inside ofscrollview
, set both of them have leading, trailing, top, , bottom constraints 0. try dynamically set width of content ,scrollview
screensize.simply surround page's content in
scrollview
set have leading, trailing, top, , bottom constraints 0. try dynamically set width ofscrollview
screensize.
both of following result in this...
notice how centered horizontally have set be, yet horizontal scrollbar present , can scroll blank screen.
you set wrong content size scrollview , hence scrolling horizontally.
scrollview.contentsize = cgsizemake(scrollview.frame.size.width, sizeofcontent);
Comments
Post a Comment