Ios--collectionview add top hover effects for Tableviewheaderview and Sectionheader similar to TableView

Source: Internet
Author: User

1. Hover effect

http://blog.csdn.net/liangyc0129/article/details/51781722

The main reference for this blog, using JHHeaderFlowLayout.h. You can generate Uicollectionreusableview.

  

Jhheaderflowlayout *layout = [[Jhheaderflowlayout alloc] init];         0 ;         Ten ;         = Uiedgeinsetsmake (kleftspace, Kleftspace, Kleftspace, kleftspace);          // Naviheight Determining the height        of the top suspension Layout.naviheight = Knav_height;

2. Top similar Tableviewheaderview effect

http://blog.csdn.net/wangyanchang21/article/details/51734750

Refer to this blog post. When there is a top set of Carousel diagram, suspended Headerview on the view effect, TableView have Tableviewheaderview,collectionview is not,

So change the inner Yanbian distance of the CollectionView, add the picture in the space of the inner extension blank.

  

// 1. Set CollectionView contentinset 0 0 0 ); // 2. Fill the picture view UIView *topview = [[UIView alloc]initwithframe:cgrectmake (0,-topimg_height, Kscreenw, Topimg_height)];< C10/>[self.collectionview Addsubview:topview];

Note: This method is feasible, but in the case of both effects need to pay attention to CollectionView Contentoffset, after adding the header, Contentoffset at this time is-topimg_height.

 

Ios--collectionview Add top hover effects for Tableviewheaderview and Sectionheader similar to TableView

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.