2

下の画像に示すように、テーブルの背景と他のいくつかのスタイルを設定しました。赤で強調表示されているインデックスは透明です。セルの他の部分と同じように白に設定するにはどうすればよいですか?

ここに画像の説明を入力してください

4

2 に答える 2

1

指定されたUITableViewプロパティを使用できます。

tableView.sectionIndexColor = [UIColor brownColor];
tableView.sectionIndexBackgroundColor = [UIColor whiteColor];
tableView.sectionIndexTrackingBackgroundColor = [UIColor blueColor];

基盤となるTableViewレイヤーをいじると、アプリが拒否される可能性があり、AppleがUITableViewの実装を変更すると機能しなくなる可能性があります。

于 2014-10-29T05:37:04.687 に答える
-1
    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...

    }
于 2013-04-30T05:23:03.480 に答える