ios - How to adjust uiscrollview after adding view (autolayout) -


The main UIView has a UIScrollView. I have container UIView inside scrollview and its edges have been pinned to the scrollview. And this container scene has consistent width and height barriers because the scroll view does not work without them.

When I add many sub views inside the container view, the sub-view becomes more than the limit below the container view. This is not a scrollable cause. The only predefined height in the container is how to make the container adjustable, it can match the sub-views height, which will scroll it.

Also think that I am using myself.

What do you really need to do is update the height barrier, okay?

I will link the height restriction of the inside view as your IBoletlet ViewController:

@ Property (Nonomatic, Weak) IBotatable NSLUT Contract * ContentviewHit;
  • Drag normal and leave the file owner

Then you will need to update your restriction with that call method once You add your subviews in:

  - (zero) Update contentview: (CGFloat) height {self.contentViewHeight.constant = height; [Yourself.Your contentview layoutInZid]; }  

If you can keep track of the height of the entire stack of subviews, great! You only have to pass it in that method.

If not, it can be a little more difficult ... you may need to remove the height barrier, add your subview below each other, fix their heights) " Do not forget to "pin" the border below the last subview to the lower border of "no visible". In other words, the height of the internal view has not been fixed but its "height-fix" content has been expanded by the addition of this:

  [self.ourContentView layout was transmitted ];  

It should be the last height in your ".frame"

Then you should be able to update the height barrier or set the content of Scrollview Works best for you.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -