Note that there are some explanatory texts on larger screens.

plurals
  1. PODefault view (as UIScrollView) of UIViewController - Can't set its content offset
    primarykey
    data
    text
    <p>According to my project, I changed the default view that tied to one UIViewController from <strong>UIView</strong> to <strong>UIScrollView</strong> as it has to be changed its offset and content size. The way I change from UIView to UIScrollView was by <strong>Interface Builder > Custom Class</strong></p> <p>If I want to change its offset and content size programmatically within The Controller, It can't be done in usual way unless I cast it</p> <pre><code>[((UIScrollView *)self.view) setContentSize:CGSizeMake(1024, 2000)]; [((UIScrollView *)self.view) setContentOffset:CGPointMake(0, 150)]; </code></pre> <p>But with other UIScrollView within the app, changing their offset and content size can be done like any other,</p> <pre><code>// Assume that sv is scroll view object [sv setContentSize:CGSizeMake(1027, 2000)]; [sv setContentOffset:CGPointMake(0, 150)]; </code></pre> <p>When I print that scroll view object, it shown as a UIScrollView</p> <pre><code>NSLog(@"%@", self.view); NSLog(@"%@", [self.view class]); -&gt; &lt;UIScrollView: 0x6d3d3f0; frame = (0 0; 1024 768); autoresize = RM+BM; layer = &lt;CALayer: 0x6d52ce0&gt;; contentOffset: {0, 0}&gt; -&gt; UIScrollView </code></pre> <p>Anyone know what I did missing or forgot to do rather than change the view's custom class?</p> <p>Best and Thank you, Tar</p> <p>P.S. Besides the extra code needed, everything works fine. But, I can't take the chance of possible bug in the future. This client is super crazy, no error will be accepted </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload