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"-
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
- Adding a normal cell instead of the section header
- If you have only one section, then you can simply use table header instead of section header
Related Topics
Once Jailbroken, Will iOS Apps Run with Root Privilege
Add a Uiview Above All, Even the Navigation Bar
How to Allow User to Pick the Image with Swift
Autolayout: Add Constraint to Superview and Not Top Layout Guide
Missing Cfbundleiconname in Xcode9 iOS11 App Release
Swift - Download a Video from Distant Url and Save It in an Photo Album
The App References Non-Public Selector in Id (Facebook Sdk iOS)
Could Not Load the "" Image Referenced from a Nib in the Bundle with Identifier
How to Change App Icon Programmatically
How to Access Both Objective-C and Swift Classes from Same Storyboard
In Firebase, How to Query the Most Recent 10 Child Nodes
How to Use Presentmodalviewcontroller to Create a Transparent View
Since Xcode 8 and iOS10, Views Are Not Sized Properly on Viewdidlayoutsubviews
How to Apply Multiple Transforms in Swift
Swift - Uibutton with Two Lines of Text
Xctest and Asynchronous Testing in Xcode 6
Instantiate View Controller from Storyboard VS. Creating New Instance