我在TableView
的顶部使用了UINavigationBar
。每当我碰到cell
并再次回到TableView NavigationBar
消失。我该怎么办?导航栏在再次回来时消失
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0{
let cell = tableView.dequeueReusableCell(withIdentifier: fa_color_arrayOfCellData[indexPath.row].cell, for: indexPath) as UITableViewCell
let (fa_ColorArgumentsContent) = fa_color_arrayOfCellData[indexPath.row].text
cell.textLabel?.text = fa_ColorArgumentsContent
cell.textLabel?.textAlignment = NSTextAlignment.right
//set the data here
return cell
}
else if indexPath.section == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: fa_system_arrayOfCellData[indexPath.row].cell, for: indexPath) as UITableViewCell
let (fa_SystemArgumentsContent) = fa_system_arrayOfCellData[indexPath.row].text
cell.textLabel?.text = fa_SystemArgumentsContent
cell.textLabel?.textAlignment = NSTextAlignment.right
//set the data here
return cell
}
else if indexPath.section == 2{
let cell = tableView.dequeueReusableCell(withIdentifier: fa_support_arrayOfCellData[indexPath.row].cell, for: indexPath) as UITableViewCell
let (fa_SupportArgumentsContent) = fa_support_arrayOfCellData[indexPath.row].text
cell.textLabel?.text = fa_SupportArgumentsContent
cell.textLabel?.textAlignment = NSTextAlignment.right
//set the data here
return cell
} else {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as UITableViewCell
let (fa_SupportArgumentsContent) = fa_color_arrayOfCellData[indexPath.row].text
cell.textLabel?.text = fa_SupportArgumentsContent
cell.textLabel?.textAlignment = NSTextAlignment.right
return cell
}
你在嵌入您的视图控制器uinavigation控制器? – Tj3n
@ Tj3n是的,我喜欢。 – fatemeh
在你的viewdidapper()中写一行self.navigationController.navigationBarHidden = NO; –