iOS:TableView干擾頂級狀態欄

[英]iOS: TableView interfering with top status bar


I'm developing an iOS application and i'm using the SWRevealViewController, i made the side-menu by adding a TableView and everything works fine, but when i open the side-menu and scroll down, the contents(cells) are interfering with the iPhone top bar.

我正在開發一個iOS應用程序,我正在使用SWRevealViewController,我通過添加TableView來制作側面菜單,一切正常,但是當我打開側面菜單並向下滾動時,內容(單元格)正在干擾iPhone頂部吧。

Please view the image below

請查看下圖

Screenshot

Usually adding a Navigation Controller solve this problem, but i can't add one here because it's a side-menu.

通常添加一個導航控制器解決了這個問題,但我不能在這里添加一個,因為它是一個側面菜單。

How can i prevent that from happening and solve this?

我怎樣才能防止這種情況發生並解決這個問題?

Thanks in advance.

提前致謝。

2 个解决方案

#1


Tty to use contentInset for side menu TableView:

Tty使用contentInset進行側面菜單TableView:

 - (void)viewDidLayoutSubviews{
    [super viewDidLayoutSubviews];
    sideMenuTableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0);
}

#2


you can use container view instead of this. take a container view in first view and embed it with another view controller.Then put your table on second view controller.Then run your code. You can get what you want. you can adjust container view according to your need. check out this link. Hope this will help you.

您可以使用容器視圖而不是此。在第一個視圖中獲取容器視圖並將其與另一個視圖控制器嵌入。然后將您的表放在第二個視圖控制器上。然后運行您的代碼。你可以得到你想要的。您可以根據需要調整容器視圖。看看這個鏈接。希望這會幫助你。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2015/05/07/721011609bf4ecbd36afd3bcb8fb59ab.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com