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
viewinside ofscrollview, set both of them have leading, trailing, top, , bottom constraints 0. try dynamically set width of content ,scrollviewscreensize.simply surround page's content in
scrollviewset have leading, trailing, top, , bottom constraints 0. try dynamically set width ofscrollviewscreensize.
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