0

我想在一个 IBAction 中启用滚动视图,然后在该操作之前我想禁用它。我该怎么做?

我从 xib 禁用了滚动视图,但它也不起作用

-(IBAction)editClick
{
    scrview.contentSize = CGSizeMake(262,textView.contentSize.height+20+imageHeight);
    myView.frame= CGRectMake(myView.frame.origin.x, myView.frame.origin.y, myView.frame.size.width, 5000);
    [scrview setContentMode:UIViewContentModeRedraw];
     NSLog(@"scrview content height%f",scrview.contentSize.height);
     //[scrview setNeedsDisplay];
     oneFingerSwipeLeft.enabled=NO;
     oneFingerSwipeRight.enabled=NO;
     swipe=NO;
     //NSLog(@"edit Click");
     //textView.editable= YES;
}

这是我的 viewdidload

- (void)viewDidLoad
{
    scrview.contentSize = CGSizeMake(262,308);
4

1 回答 1

1

试试这个.... 在你的 viewDidLoad

your_scrollView.scrollEnabled=NO;

然后在你 IBAction

your_scrollView.scrollEnabled=YES;
于 2012-08-29T06:18:06.410 回答