Я делаю свои проекты с помощью iphone, где я перечисляю несколько событий в uitableview
(masterview), и я покажу детали в viewController
(detailview). Я отображаю текст в виде таблицы в виде зеленого цвета, после считывания данных данные внутри ячейки должны иметь красный цвет. уведомлять его как прочитанного и непрочитанного. как это сделать? PLS помочь мне. вот мой cellforrowindexpathКак изменить цвет текста после чтения деталей?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"newsCell1";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
MainNews *msglist = [samplearray objectAtIndex:indexPath.row];
cell.textLabel.text = msglist.newsletters;
cell.textLabel.textColor = [UIColor greenColor];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
и вот мой didselectatrowindexpath код:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"NewsDetails"]) {
NSIndexPath *indexPath = [tblView indexPathForSelectedRow];
MainNewsDetailController *destViewController = segue.destinationViewController;
MainNews *aEvent1 = [samplearray objectAtIndex:indexPath.row];
destViewController.eveID = aEvent1.id;
destViewController.usrid = memberid;
}
}
так, как изменить цвет в Tableview после прочтения детали. pls помогите мне заранее спасибо
скажите мне, как iphone обнаружит, что вы читаете какую-либо строку или нет? как вы думаете, это возможно автоматически? –