How to remove blue highlighting when selecting in UIPickerView

when I select a cell in my modified form, a blue background color appears. all the other protectors that I have seen do not give me a good answer. who has a solution?

+5
source share
4 answers

pickerView.showsSelectionIndicator = NO;

+3
source

Just set the UITableViewCell selectionStyle property to UITableViewCellEditingStyleNone

cell.selectionStyle = UITableViewCellEditingStyleNone;
0
source

​​ cutom , , Main view, .

0

. . , UIView, .

@interface TimeAroundView : UIView 
{
    NSString *title;
    UIImage *image;
}
@property (nonatomic, retain) NSString *title;
@property (nonatomic, retain) UIImage *image;
@end

, . NSArray, TimeAroundView, . ,

timeAroundViewObject.userInteractionEnabled = NO;

- (id) init - , - :

- (id)init
{
    self = [super init];
    if (self) {
        // create the data source for this custom picker
        NSMutableArray *viewArray = [[NSMutableArray alloc] init];

        TimeAroundView *earlyMorningView = [[TimeAroundView alloc] initWithFrame:CGRectZero];
        earlyMorningView.title = @"Early Morning";
        earlyMorningView.image = [UIImage imageNamed:@"12-6AM.png"];
        earlyMorningView.userInteractionEnabled = NO;
        [viewArray addObject:earlyMorningView];
        [earlyMorningView release];

        TimeAroundView *lateMorningView = [[TimeAroundView alloc] initWithFrame:CGRectZero];
        lateMorningView.title = @"Late Morning";
        lateMorningView.image = [UIImage imageNamed:@"6-12AM.png"];
        lateMorningView.userInteractionEnabled = NO;
        [viewArray addObject:lateMorningView];
        [lateMorningView release];

        // ....  (more of objects)

        self.customPickerArray = viewArray;
        [viewArray release];
    }

    return self;
}

pickerView: viewForRow: forComponent: reusingView: . .

0

All Articles