How to Disable Floating Headers in Uitableview with Uitableviewstyleplain

Is it possible to disable floating headers in UITableView with UITableViewStylePlain?

You should be able to fake this by using a custom cell to do your header rows. These will then scroll like any other cell in the table view.

You just need to add some logic in your cellForRowAtIndexPath to return the right cell type when it is a header row.

You'll probably have to manage your sections yourself though, i.e. have everything in one section and fake the headers. (You could also try returning a hidden view for the header view, but I don't know if that will work)

Is it possible to disable floating headers in UITableView with UITableViewStylePlain?

You should be able to fake this by using a custom cell to do your header rows. These will then scroll like any other cell in the table view.

You just need to add some logic in your cellForRowAtIndexPath to return the right cell type when it is a header row.

You'll probably have to manage your sections yourself though, i.e. have everything in one section and fake the headers. (You could also try returning a hidden view for the header view, but I don't know if that will work)

Avoid header to scroll in in UITableView with UITableViewStylePlain in ios?

you can do like this as mention babyPanda like you have to take one UIView and UItableview into Your XIB.

Like bellow image"-

Sample Image

i just create a Demo for you please check bellow link and try, Hope its helps you

http://www.sendspace.com/file/xguycm

UITableView with fixed section headers

The headers only remain fixed (floating) when the UITableViewStyle property of the table is set to UITableViewStylePlain.

If you have it set to UITableViewStyleGrouped, the headers will scroll up with the cells (will not float).

UITableView don't float section headers

I guess either you will have to use two kinds of custom tableCells or skip the tableview entirely and work on a plain scrollview to achieve this kind of style.

how can i make headerView scroll (not stay on the top of the tableview ) accompanying with UItableViewCell when i was scrolling tableview

subclass the UITableView and override this method

- (BOOL)allowsHeaderViewsToFloat{
return NO;
}

same for footer

- (BOOL)allowsFooterViewToFloat{
return NO;
}

But I think that this is a private API ... You will not be able to submit it to the AppStore

If you will upload it to the AppStore; Then you have two other options

  1. Adding a normal cell instead of the section header
  2. If you have only one section, then you can simply use table header instead of section header


Related Topics



Leave a reply



Submit