Let UIImageView in header section of UITableView overlap the content cells

rohan23

I would like to have a header section in a table view with a logo and name. Now, I want the logo to overlap the image in the content cell below. I have attached an example of this below :-

enter image description here

Heres what I've tried so far, I've tried to make the header section half the size of (logo + upper and lower padding) -- this just cuts the logo in half

I also tried clipToBounds :-

func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
    return 33.0
}



func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {

    let cell = tableView.dequeueReusableCellWithIdentifier("headerCell") as! FeedTableViewHeaderCell
    cell.designerNameLabel.text = "Vitamin A"
    cell.designerLogoImageView.image = UIImage(named: "zeko_small")
    cell.designerLogoImageView.clipsToBounds = false
    cell.contentView.clipsToBounds = false
    return cell

}
Milan Manwar

You may set ImageViewFrameHeight greater than TableViewHeaderHeight and In your TableHeaderViewCell, set

TableHeaderViewCell.contentView.clipsToSubview = NO.

This'll definitely help you in getting your result.

Visual guide from XCode 7: enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

UITableview refreshing cells scrolling under section header

From Dev

UITableView overlap cells (force)

From Dev

Content section overlap footer

From Dev

UITableView Section Header not showing

From Dev

How to pad a UITableView section header?

From Dev

UITableView section header inset missing

From Dev

Adding UIButton to UITableView section header

From Dev

Set color of UITableView Section Header

From Dev

Section Header Not Showing in Programmatic UITableView

From Dev

Resolving overlap between fixed header and first section

From Dev

Resolving overlap between fixed header and first section

From Dev

Content of static cells not appearing UITableView

From Dev

UITableview not showing content/ empty cells

From Dev

UITableView Section is too tall for the cells it contains

From Dev

How these UITableView section index lays over the cells

From Dev

Dompdf default page header content overlap

From Dev

prevent content to overlap margin of sticky header

From Dev

Uneven section header size in static UITableView

From Dev

Section header cannot be hidden in UITableView with UITableViewAutomaticDimension

From Dev

How to add a UISegmentedControl to Section header of UITableView with margin?

From Dev

Design UITableView's section header in Interface Builder

From Dev

iOS UITableView showing section header programmatically

From Dev

UITableView & Sections - to detect if a section header is stays on top

From Dev

How to add a UISegmentedControl to Section header of UITableView with margin?

From Dev

How to make the first row of an UITableView a header of a section?

From Dev

customize UITableView Header Section at run time

From Dev

Section header cannot be hidden in UITableView with UITableViewAutomaticDimension

From Dev

UITableView section header floating after changing tab

From Dev

UITableView section header does not always draw

Related Related

  1. 1

    UITableview refreshing cells scrolling under section header

  2. 2

    UITableView overlap cells (force)

  3. 3

    Content section overlap footer

  4. 4

    UITableView Section Header not showing

  5. 5

    How to pad a UITableView section header?

  6. 6

    UITableView section header inset missing

  7. 7

    Adding UIButton to UITableView section header

  8. 8

    Set color of UITableView Section Header

  9. 9

    Section Header Not Showing in Programmatic UITableView

  10. 10

    Resolving overlap between fixed header and first section

  11. 11

    Resolving overlap between fixed header and first section

  12. 12

    Content of static cells not appearing UITableView

  13. 13

    UITableview not showing content/ empty cells

  14. 14

    UITableView Section is too tall for the cells it contains

  15. 15

    How these UITableView section index lays over the cells

  16. 16

    Dompdf default page header content overlap

  17. 17

    prevent content to overlap margin of sticky header

  18. 18

    Uneven section header size in static UITableView

  19. 19

    Section header cannot be hidden in UITableView with UITableViewAutomaticDimension

  20. 20

    How to add a UISegmentedControl to Section header of UITableView with margin?

  21. 21

    Design UITableView's section header in Interface Builder

  22. 22

    iOS UITableView showing section header programmatically

  23. 23

    UITableView & Sections - to detect if a section header is stays on top

  24. 24

    How to add a UISegmentedControl to Section header of UITableView with margin?

  25. 25

    How to make the first row of an UITableView a header of a section?

  26. 26

    customize UITableView Header Section at run time

  27. 27

    Section header cannot be hidden in UITableView with UITableViewAutomaticDimension

  28. 28

    UITableView section header floating after changing tab

  29. 29

    UITableView section header does not always draw

HotTag

Archive