1

enter image description here
I have UITableview which starts center in UIView and I want to move my tableview at top of navigation bar. So I set clipsToBounds property to false for my tableview. When my tableview scrolls up after crossing my tableview bounds my custom cell gets disappeared automatically.

Is it possible to avoid UITableViewCell hidden?

I also tried my custom cell and its content view clipsToBounds property to false. Nothing works. iPhone default calendar app works well.. I want similar functions.

// MARK: - UITableview Delegates
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 20
    }

    func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
    }

    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 60
    }

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
    {
        let feedcell = tableView.dequeueReusableCell(withIdentifier: "customCell") as! customCell
        return feedcell
    }
Giorgio
  • 1,973
  • 4
  • 36
  • 51
vinoth87
  • 200
  • 1
  • 2
  • 16
  • post some code first. How are you adding the cell to tableview – Vinodh Jan 11 '18 at 08:18
  • What do you mean by the table view being at the top of the navigation bar. Do you mean the table goes behind the navigation bar or something else? – Upholder Of Truth Jan 11 '18 at 09:47
  • In attached image tableviewcells is traveling behind the black bar because I set tableview clipstobounds to false. But cells are not traveling up to top of view its automatically hides when I scroll further. What I mean here is uitableviewcells are hidden when its crossed uitableview frame or bounds sizes. I want my cells to travel behind the black bar to at top edge of black bar. Will it be possible? – vinoth87 Jan 11 '18 at 10:28
  • @vinoth87 I have the same issue could you please let me know if you are able to find out the solution – VSP Jan 15 '20 at 12:58

1 Answers1

0

UITableView reuses cells so scrolling is as smooth as possible. So if a cell is leaving the bounds of the TableView it is removed from the TableView to be reused for the next appearing cell.

You could check this to try to let the cell scroll behind a translucent navigation bar.

brototyp
  • 26
  • 1
  • 2
  • I am not using navigation bar... I am just using UIView with opacity.. Will it be possible? – vinoth87 Jan 11 '18 at 11:10
  • In this case try to increase the frame of the TableView such that it extends under that view and then shift the cells down using contentInsets (`self.tableView.contentInset = UIEdgeInsets(top: 44, left: 0, bottom: 0, right: 0)`). – brototyp Jan 11 '18 at 11:14
  • What is the problem? – brototyp Jan 11 '18 at 11:57
  • Still uitableviewcells are hidden under black bar. After setting content inset to tableview – vinoth87 Jan 11 '18 at 12:09
  • Can you attach a screenshot? If I understand your problem correct, this solutions should work. Maybe I didn't understand your problem properly? – brototyp Jan 11 '18 at 12:29
  • sorry for the delay. I have recorded video how can I post it here? – vinoth87 Jan 11 '18 at 15:32
  • I uploaded video to google drive.. This is link to video https://drive.google.com/open?id=1czjz5db4nYq1wxdwXysCz19BchchWH-V Plz take a look at give response. If you clear with issue. The tableviewcells hiding is clearly visible in video. Thanks – vinoth87 Jan 11 '18 at 16:02
  • Can you use the ViewDebugger and ensure that the Frame of the TableView extends to edge of the device. I think the frame ends exactly at the edge to the black translucent view. – brototyp Jan 11 '18 at 19:45
  • sorry my mistake.. Works perfectly... Thanks – vinoth87 Jan 13 '18 at 11:53
  • Awesome! Thanks for the feedback. – brototyp Jan 18 '18 at 13:41