2016-05-12 32 views
0

我想知道,如何顯示未讀消息欄或現在whatsapp顯示「您發送給此聊天和呼叫的消息現在已被保護......」,或者在遠程ios應用程序中顯示計數高於單元格的新消息。如何顯示unread消息欄

我想知道這些應用程序如何在tableview中注入這些欄?
它是單元格或標題視圖還是該邏輯的工作原理?
它們是否動態更新numberofrows?

enter image description here

回答

0

您可以通過使用viewForHeaderInSection實現這一目標。這個方法給你選擇自定義headerView。試試這個,

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 

等注: 有關顯示日期[像今天,昨天,14-4-16],我們可以使用titleForHeaderInSection

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section 
+1

嗨@ramdy,我通過在單元格中插入視圖實現了這一點。並在需要顯示時根據場景進行切換。隱藏視圖漸漸消失。 – karthik