UIView *lineView = [[UIView alloc]init]; lineView.frame = CGRectMake(0,50,self.View.frame.size.width,1); lineView.backgroundColor = [UIColor blackColor]; [self.view addSubview:lineView];
Take this simple view created in the code and simply adjust its height to 1 or 2. Like in the code above → lineView.frame = CGRectMake (<#CGFloat x #>, <#CGFloat y #>, <#CGFloat width # >, <#CGFloat height #>); CGFloat height is taken 1
source share