Apple からの新しい UI 情報を調べましたが、役に立ちませんでした。
コードとスクリーンショットで、私が遭遇した問題を示しましょう。それが私のバグのあるコードではないことを確認するために、id 内に tableView を持つ UIViewController という単一のファイルを使用して、新しいプロジェクトを作成しました。代表者が設定されます。
私は次のことを行います:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"UITableViewCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [NSString stringWithFormat:@"%d",indexPath.row];
// Configure the cell...
UIView * redView = [[UIView alloc] initWithFrame:CGRectMake(0, -10, 100, 20)];
redView.backgroundColor = [UIColor redColor];
[cell addSubview:redView];
return cell;
}
テーブルビューはGroupedに設定されています。iOS 6 で実行してみましょう:
もちろん、Y 原点は負です。はい、そうです。これが私が達成しようとしている結果です。iOS 7 で表示される内容を見てみましょう。
ヒント: 通常の UIView に redView を追加した場合は発生しません。
別のヒント: tableView の背景色を青に設定すると、セクション間の灰色の線は灰色ではなく青色になります (灰色が設定されたヘッダーではないことのデモンストレーションとして)。別のヒント: ipad についても同様です。
iOS 7 では、境界を超えるものをすべてカットするのはなぜですか? 助けてください!