下の画像に示すように、テーブルの背景と他のいくつかのスタイルを設定しました。赤で強調表示されているインデックスは透明です。セルの他の部分と同じように白に設定するにはどうすればよいですか?
下の画像に示すように、テーブルの背景と他のいくつかのスタイルを設定しました。赤で強調表示されているインデックスは透明です。セルの他の部分と同じように白に設定するにはどうすればよいですか?
指定されたUITableViewプロパティを使用できます。
tableView.sectionIndexColor = [UIColor brownColor];
tableView.sectionIndexBackgroundColor = [UIColor whiteColor];
tableView.sectionIndexTrackingBackgroundColor = [UIColor blueColor];
基盤となるTableViewレイヤーをいじると、アプリが拒否される可能性があり、AppleがUITableViewの実装を変更すると機能しなくなる可能性があります。
its too much easy dude.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
for(UIView *view in [tableView subviews])
{
if([[[view class] description] isEqualToString:@"UITableViewIndex"])
{
[view performSelector:@selector(setIndexColor:) withObject:[UIColor whiteColor]];
//give color which you want
}
}
static NSString *MyIdentifier = @"MyIdentifier";
//go further with table cell design...
}