Adding a separator to a UICollectionViewCell as in a UITableViewCell

Hi guys, I am developing an application in which I need a "separator line" after each line UICollectionViewCell... (as in UITableViewafter every line).

Does anyone have an idea how to get this ... Since I'm new to iOS ..

Thanks in advance.

+4
source share
1 answer

Create a UIView with a black background, 1 pixel high and 320 pixels wide?

Example

For the horizontal line

UIView *horizontalLine = [[UIView alloc]initWithFrame:CGRectMake(x cordinate,y cordinate,1,linelenth)];
horizontalLine.backgroundColor = [UIColor blackColor];
[self.view addSubview:horizontalLine];
[horizontalLine release];

For the vertical line

UIView *verticalLine = [[UIView alloc]initWithFrame:CGRectMake(x cordinate,y cordinate,linelenth,1)];
verticalLine.backgroundColor = [UIColor blackColor];
[self.view addSubview:verticalLine];
[verticalLine release];
-4
source

Source: https://habr.com/ru/post/1538524/


All Articles