thisのようにuitableview
を作成します。サーバーからデータをロードし、その値をRowの列に割り当てます。私はスタックのlinkを見たが、私にとっては役に立たなかった。 UPDATE 私のコード: -風景モードでGRIDのようなUITableViewを作成するには?
#pragma mark UITableViewDelegate methods
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger) section {
return [modelArray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = nil;
static NSString *AutoCompleteRowIdentifier = @"AutoCompleteRowIdentifier";
cell = [tableView dequeueReusableCellWithIdentifier:AutoCompleteRowIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:AutoCompleteRowIdentifier] autorelease];
}
cell.selectionStyle = UITableViewCellSelectionStyleGray;
// Configure the cell...
RankModel *model = [modelArray objectAtIndex:indexPath.row];
cell.textLabel.text = [NSString stringWithFormat:@"%@ %@ %@ %@ %@ %@", model.level, model.name, model.score, model.rightAnswersCount, model.currentRank, model.country];
return cell;
}
が、私は与えられた画像のように表示したいです。この問題を克服するために私を助けてください。前もって感謝します。
私はあなたに投票して解決策を受け入れるでしょう。どうもありがとうございました。 – Lion