Make UIView scrollable

I know that I need to insert a UIScrollView into my UIView, and in myLoad view, put the sizeContent of my IBOutlet UIScrollView, but I have some doubts because this does not work for me, I think there is some information missing for me.

The size of my UIView is 320x678 so I need to scroll it up / up vertically, I googled, but some methods but always fail or not work, I deploy target system to iOS 4.3 so that my app works for all iOS> = 4.3. and at this moment I need help to clear my mind ...

What steps should be taken from start to finish? and the scroll view should be in the foreground or background of the whole controller?

EDIT: I did this ....

|-button-||-imgview-||-button-| |-some-|
|-------scrollview content size--------|  Size = 320x678
|--------------scrollview--------------|  Size = 320x678
|----------------view------------------|  Size = 320x678

      

And probably my mistake, but why can't I make my iPhone scrollable?

|-----iPhone screen-----|
|-------------My app------------|

      

If I don’t do some scrolling trick, I don’t see more than my iPhone screen, is there no auto-scrolling for such "problems"? or should I do what you told me?

Because now my problem is that I need to rebuild my .xib and I really don't understand how to do this, theory I understand but not how.

EDIT2:

I have corrected your theory.

1.- I created a Iphone screen 3.5
2.- I created an auxiliar view with freeform and adapted to 320x678
3.- I designed my 320x678 view
4.- In my main .xib I added my scroll IBOutlet and in the IB then linked.
5.- On my loadview I added the sizecontent
6.- I dragged to my 3.5 screen all the content from my auxiliar window.. then I deleted the auxiliar window.

      

Thank.

+3


source to share


1 answer


I think you have your scrolling ideas wrong.

To use a scroll view, you add it to a view that is not scrolling. those. yourViewController.view

... Then you add content to yours scrollView

and set contentSize

to scrollView

.

scrollView

contains its own view that scrolls.

i.e.



|-button-|     |-button-|    |--label--|
|-------scrollview content size--------|  Size = 320x678
|--scrollview----|   Size = 320x480
|------view------|   Size = 320x480

      

Then a button and a half will be shown, but you can scroll through them so you can see the shortcut.

Hope this makes sense.

+5


source







All Articles