How to create a UIScrollView Programmatically?

后端 未结 7 1078
后悔当初
后悔当初 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条回答
  •  粉色の甜心
    2020-12-01 00:05

    try this,

    {
    
            scrollview=[[UIScrollView alloc]initWithFrame:CGRectMake(0,0,320,480)]; 
            scrollview.showsVerticalScrollIndicator=YES;
            scrollview.scrollEnabled=YES;
            scrollview.userInteractionEnabled=YES;
            [self.view addSubview:scrollview];
            scrollview.contentSize = CGSizeMake(width,height);
    
        [scrollview release];
    }
    

提交回复
热议问题