我有一個隱藏的標籤,只有當我通過didSelectRow單擊單元格時出現一個TableView。在TableView上顯示標籤。滾動時消失TableView
到目前爲止,當我選擇單元格時,會顯示橙色標籤(如圖所示),但當tableView滾動標籤時會出現問題橙色消失,並且僅在更改頁...
橙色標籤指示好友請求是否正在等待,並且引用另一個頁面中存在的查詢,這要歸功於用prepareforsegue報告的可變數組。
你能解釋爲什麼橙色標籤消失嗎?當我選擇單元格時,如何讓它停留在TableView上? 標籤橙色是「RichiestaInAttesaLabel」 P.我使用Parse.com
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
FFCustomCellUtentiGenerali *cell =[self.TableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[FFCustomCellUtentiGenerali alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
if (!isFiltered) {
PFObject *object = [self.Utenti objectAtIndex:indexPath.row];
NSString *str = [object objectForKey:FF_USER_NOMECOGNOME];
cell.NomeCognome.text = str;
cell.FFFotoProfilo.file = [object objectForKey:FF_USER_FOTOPROFILO];
cell.FFFotoProfilo.image = [UIImage imageNamed:@"FFNoFotoUSer"];
[cell.FFFotoProfilo.layer setMasksToBounds:YES];
[cell.FFFotoProfilo.layer setCornerRadius:30.0f];
cell.FFFotoProfilo.contentMode = UIViewContentModeScaleAspectFill;
[cell.FFFotoProfilo loadInBackground];
[cell.BackgroundReputazioneBlu.layer setMasksToBounds:YES];
[cell.BackgroundReputazioneBlu.layer setCornerRadius:15.0f];
[cell.BackGroundReputazione.layer setMasksToBounds:YES];
[cell.BackGroundReputazione.layer setCornerRadius:17.0f];
[cell.TapAggiungiLabel.layer setMasksToBounds:YES];
[cell.TapAggiungiLabel.layer setCornerRadius:3.0f];
[cell.RichiestaInAttesaLabel.layer setMasksToBounds:YES];
[cell.RichiestaInAttesaLabel.layer setCornerRadius:3.0f];
PFUser *user = [self.Utenti objectAtIndex:indexPath.row];
[cell.TapAggiungiLabel setHidden:YES];
[cell.RichiestaInAttesaLabel setHidden:NO];
if ([self isFriend:user]) {
[cell.TapAggiungiLabel setHidden:YES];
[cell.RichiestaInAttesaLabel setHidden:YES];
}
else {
[cell.TapAggiungiLabel setHidden:NO];
[cell.RichiestaInAttesaLabel setHidden:YES ];
}
if ([self Is_InAttesa:user]) {
[cell.RichiestaInAttesaLabel setHidden:NO];
[cell.TapAggiungiLabel setHidden:YES];
}
else {
[cell.RichiestaInAttesaLabel setHidden:YES];
}
}
//end IsFiltred
else {
如果完成if(!isFiltered){? – Ilario
檢查我的編輯代碼 – kAiN