How to create a UIScrollView Programmatically?

后端 未结 7 1076
后悔当初
后悔当初 2020-11-30 23:38

Alright, so the key here is I\'m not using IB at all, because the View I\'m working with is created programmatically. The UIView covers the lower half the scre

7条回答
  •  -上瘾入骨i
    2020-12-01 00:22

    Instead of:

    UIScrollView *scroll = [UIScrollView alloc];
    

    do this (setting the frame to however big you want the scroll view to be):

    UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:...];
    

提交回复
热议问题