Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popover with tableView didn't scroll #113

Open
fcsd opened this issue Nov 6, 2018 · 1 comment
Open

Popover with tableView didn't scroll #113

fcsd opened this issue Nov 6, 2018 · 1 comment

Comments

@fcsd
Copy link

fcsd commented Nov 6, 2018

I use this library. TableView in popover doesn't scroll.

let minPopoverHeight = CGFloat(264)

 lazy var popoverTableView: UITableView = {
        let tableView = UITableView()
        tableView.delegate = self
        tableView.dataSource = self
        tableView.tableFooterView = UIView()
        tableView.tag = SearchableTableViewTag.search.rawValue
        return tableView
    }()

    override func viewWillLayoutSubviews() {
        popoverTableView.frame = CGRect(x: 0, y: tableContainer.bounds.origin.y, width: view.bounds.size.width, height: minPopoverHeight)
    }

func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {
        let popoverOptions = [
            .type(.down),
            .animationIn(0.3),
            .showBlackOverlay(false),
            .arrowSize(.zero),
            .color(.white),
            .dismissOnBlackOverlayTap(true),
        ] as [PopoverOption]
        
        searchPopover = Popover(options: popoverOptions, showHandler: nil, dismissHandler: {
            self.searchController.isActive = false
        })
        
        searchPopover?.show(popoverTableView, fromView: searchBar)
        return true
    }

That's way I use Popover.

@Harsh061
Copy link

Harsh061 commented Feb 8, 2019

Hi @fcsd
You can try setting tableView.isScrollEnabled = true programatically. It worked for me.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants