0

1つのマスタービューに2つのテーブルビューが必要です。私のアプリケーションはランドスケープモードでのみ実行されます。左側が最初のテーブルビューで、右側が2番目のテーブルビューです。私は今これらの2つを持っています。

右側にさらに4つの追加ビューを呼び出す必要があります。ただし、左側にはビュー名のリストが表示されるため、このビュー呼び出しは左側のテーブルビューから行う必要があります。セルをクリックすると、右側のビューにクリックしたビューが表示されます。

私はsplitviewを使用しておらず、このアプリケーションでsplitviewが必要ないので、左側からそのビューを呼び出すにはどうすればよいですか?

4

1 に答える 1

0

左側に 1 つ、右側に 2 つ目の 2 つのテーブルを使用できます。tableview.tag = 2;

左側のテーブルの任意の行をクリックしながら、タグ = 2 でテーブル ビューをリロードするだけです。

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section        {
     if (tableView.tag == 1)
                return 5;
            else if (tableView.tag == 2)
                return 10;
        }


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

            static NSString *identifier = @"CellIdentifier";    
            UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];

            if (cell == nil) {
                cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease];

            }
            if (tableView.tag == 1)
            {
        ///// Do whatever you want to do
            }
            else if (tableView.tag == 2)
            {
        ///// Do whatever you want to do
            }
            cell.textLabel.text = @"example";       
            return cell;
        }
于 2012-10-15T08:08:01.863 に答える