-(void)setCityBgcolor:(int)row indexLetter:(NSString *)letter
{
if (row != frontRow || (row == 0 && !rowZeroOneTime)) {
UIImageView *citylistBgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"citylist_bg.png"]];
citylistBgView.frame = CGRectMake(0, originY, 320, 42);
[self.cityScrollView addSubview:citylistBgView];
citylistBgView.tag = citylistBgViewtag;
citylistBgViewtag++;
cityIndexImageView = [[UIImageViewalloc] initWithImage:[UIImageimageNamed:@"city_index_bg.png"]];
cityIndexImageView.frame = CGRectMake(0, row*41-1, 14, 42);
cityIndexImageView.backgroundColor = [UIColorclearColor];
if (![frontLetter isEqualToString:letter]) {
UILabel *label = [[UILabel alloc] init];
[label setFont:[UIFont fontWithName:@"Helvetica" size:12.0]];
label.frame = CGRectMake(2, 0, 14, 42);
label.backgroundColor = [UIColor clearColor];
label.text = letter;
label.textColor = [UIColor whiteColor];
[cityIndexImageView addSubview:label];
}
cityIndexImageView.tag = imageIndexViewTag;
imageIndexViewTag ++;
[self.cityScrollViewaddSubview:cityIndexImageView];
rowZeroOneTime = YES;
originY = originY+41;
frontLetter = letter;
}
frontRow = row;
}