0

私の質問は2つの部分です:

パート1:

UITableViewユーザーが任意のセルをクリックすると、内部が表示UITableViewされ、マスターのサイズを拡大してから、UITableView内部を挿入しますUITableView

internalTableView = [[InternalApartmentTableViewController alloc] initWithFrame:CGRectMake(0, 44, 550, (([[tableContent objectAtIndex:indexPath.row] count] - 1) * 44))];
[cell addSubview:internalTableView];

didSelectedRow は次のとおりです。

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (selectedInternal != -1) {
    selectedInternal = -1;
} else {
    selectedInternal = indexPath.row;
    [internalTableView removeFromSuperview];
    [internalTableView release];
}
[tableViews reloadData];

}

内部に少数の行を使用してアプリをテストしていましたがUITableView、高さ = 700 で、実際のデータを使用したときの高さ = 2500 とデータが表示されたときの高さ = 1000 の間ですべてが完全に機能します。 、内部UITableViewをスクロール可能にする必要はありません。マスターだけUITableViewがスクロール可能です。

UTableViewでは、どうすれば のフレーム サイズを好きなだけ拡張できますか?

パート2:

内部UITableViewでは、ラベルと画像、および 2 つのボタンを含むカスタム セルを使用しました。ボタンの 1 つはクリックされたときにUIPopOver表示されます。ビュー内のボタンの場所を特定できません。 、実際には、を使用しUIPopOverて画面に表示するためにどのビューを使用する必要があるかわかりません

[popoverController presentPopoverFromRect: //(How can i get the rect for the button)
                   inView: //(in which view should the PopOver appear, master UITableView or Internal UITableView or Custom Cell)
                   permittedArrowDirections:UIPopoverArrowDirectionLeft
                   animated:YES];

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

4

1 に答える 1

1

//カスタムセルのボタンが押されたとき

if(![tempPopover isPopoverVisible])
{

    UIButton* btn=(UIButton *)sender;
    NSIndexPath*indexpath=[NSIndexPath indexPathForRow:btn.tag inSection:0];
    cell=(customCell *)[tableView cellForRowAtIndexPath:indexpath];

        popoverController *objView = [[popoverController alloc] init];

        tempPopover = [[UIPopoverController alloc] initWithContentViewController:objView];
        [tempPopover setPopoverContentSize:CGSizeMake(160, 160)];
        [tempPopover presentPopoverFromRect:CGRectMake(655, cell.contentView.frame.origin.y-105, 150, 150) inView:cell.contentView permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];

}
于 2012-06-12T04:48:30.360 に答える