0

私は目的の C を初めて使用し、コンテンツに応じて動的な高さを ScrollView に設定する必要があります。UIView があり、その中に UIScrollView があります。ビューにいくつかの UILabels、UIButtons などがあります。現在、余分なスペースが表示されており、データがなくても一番下までスクロールできます。したがって、データが完了したら、スクロールを停止する必要があります。どうすればいいですか?

[testscroll setScrollEnabled:YES];
[testscroll setContentSize:CGSizeMake(320,800)];//static size to UISCrollView


-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    UIButton *button=[[UIButton alloc] initWithFrame:rect];
    [button setFrame:rect];
    [button setContentMode:UIViewContentModeLeft]; 
    NSString *settitle=[NSString stringWithFormat:@"%@",item.Name]; 
    [button setTitle:settitle forState:UIControlStateNormal];
    NSString *tagValue=[NSString stringWithFormat:@"%d%d",indexPath.section+1,i]; 
    button.tag=[tagValue intValue];
    [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
    [hlcell.contentView addSubview:button];
    [button release];

}

どんな助けでも大歓迎です。

4

1 に答える 1