Я работаю на следующее: ScreenshotИзменение размера полного экрана Tableview при нажатии
В основном это один UIImageView внутри другого UIImageView в верхней части (60% от экрана) и UITableView, который занимает 40% от экран
и код (см ниже):
То, что я пытаюсь добиться, чтобы изменить размеры ячеек полного экрана UITableView, когда мой customCell щелкнул и unsize его в своем первоначальном состоянии, когда unclicked.
Есть ли способ сделать эту работу? Спасибо заранее.
//Label outlets
@IBOutlet weak var tableView: UITableView!
var selectedIndexPath : IndexPath? = nil
override func viewDidLoad() {
super.viewDidLoad()
//MARK Start of CustomViewCell Code
tableView.register(UINib(nibName: "CustomViewCell", bundle: nil), forCellReuseIdentifier: "Cell")
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 5
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell") as! CustomViewCell
cell.clipsToBounds = true
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
let index = indexPath
if selectedIndexPath != nil {
if index == selectedIndexPath {
return 667
} else {
return 62
}
} else {
return 62}
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
switch selectedIndexPath {
case nil:
selectedIndexPath = indexPath
default:
if selectedIndexPath! == indexPath {
selectedIndexPath = nil
} else {
selectedIndexPath = indexPath
}
}
tableView.reloadRows(at: [indexPath], with: .automatic)
}
//MARK End of CustomViewCell Code
Каково содержание вашего 'tableViewCell', которые вы собираетесь сделать полноэкранный режим? У этого есть 'imageView'? – Santosh
Нет @Santosh 'labels' и' textView' – j0h4nf