Over lapping shadows on collection view cells - swift

I'm trying to add a shadow to each collection view cell within a section controller with IGListKit, but the shadows overlap on to other cells causing a line to appear at the top/bottom.
Any help would be appreciated.

For your case: https://github.com/Instagram/IGListKit/issues/335
Have you tried it?
Try this solution: set Inset, not LineSpacing

Related

How to set margin for cell in tableView?

I tried to set a margin for a certain cell in my TableView by using code as below:
cell.layoutMargin.left = 20
However, when I launched the application, it changes nothing on the appearance. Is there any way I could achieve this?
For margins to take effect in any UIView, any constraints must have the "Constrain to margins" checked. Otherwise, the margins will not change any subview's constraints on the superview.
If you are adding constraints with Swift, here is an example of adding constraints relative to margins from Apple. The key part is:
// Get the superview's layout
let margins = view.layoutMarginsGuide
// Pin the leading edge of myView to the margin's leading edge
myView.leadingAnchor.constraint(equalTo: margins.leadingAnchor).isActive = true
Ensure that your view is being updated and that any changes you are making to UIView is from the main thread.
To give a more thorough answer, more data is needed on your current auto layout setup.
I found a solution or alternative for this problem after getting help from my colleague, what we did was creating an IBOutlet for the constraint (which I just discover). So in UITableviewCell class, i add this line of code :
#IBOutlet var boxLeadingContraint: NSLayoutConstraint!
And in UITableView I set the margin for the specified cell like this:
cell.boxLeadingContraint.constant = 10
Note: I did this on a UIImageView inside the cell not on the cell itself. Any feedback or advice will be appreciated.

Set UITableviewcell frame when tableview editing enable

I am showing data in tableview and on editing it will be as in image. (i had allowed editing only for rows those were come after 4 th index).
Now i want to first four image cell frame as in the below reference image.
And i last i need the output as in the below reference image
.
If any suggestion or references for this problem.
Thanks
For the first four cells, set a transparent image to cell.imageView.image This is not the perfect answer by any means but this will do the trick you want.
OR
For the four cells you can set the cell.textLabel.text by adding few spaces upfront like,
cell.textLabel.text = #" YOUR TEXT";
Your question is not clear.
I think you need the text alignment of all cells in same manner. If it is the case, I'll suggest three options:
When editing is pressed reload the tableView and add necessary spaces for first 3 rows
If you are using custom cells make another one for first three cells with exact spaces
If you are adding UILabel as subview of these cells change the frame
You can create the following by creating two sections in the UITableView , where for the second view you can set the editing TRUE (not in first section) . Also pass the title for second section as "On My Pad" as shown in your reference image .
Hope it will help you !

Removing the line separator but not the border in a UITableView

I want to remove the line separator in a grouped table view cell, but not the border of the table.
I used this code to remove the separator but it removes the border also:
profileTable.separatorColor:[UIColor clearColor];
The screen shot explains what I need.
Is there any code available to remove it?
Following code may be help to you.
profileTable.separatorStyle = UITableViewCellSeparatorStyleNone;
One solution to your problem, could be to create a custom layout for your grouped tableview. So you would create a top, middle and bottom part of the cells, and then add a border only to the sides.
I used this tutorial: http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
var tableView = Ti.UI.createTableView({ separatorColor: 'transparent', backgroundColor: '#FFFFFF' });

Scroll UITableView Header?

I have a custom UITableView header which I want to be able to scroll above the top of the table. Normally the header would stick to the top of the table, is it not possible to somehow change to scrolling ability so that it can go beyond that and scrolls with the cells in the table?
Thanks.
Well if that is the desired behavior you want, just put the header as the first cell's content. It is possible to customize any particular cell you want. UITableViewDelegate documentaion will help you in that matter.
PS: the whole point of using tableView header is to make it stick to the top of the window.
EDIT: If it is necessary that you have to do the way you want, then you can try this: move your tableView a little down by setting its contentOffset. eg: myTableView.contentOffset= CGPointMake(0,heightOfYourView) . Now add yourView at the top
myTableView.tableViewHeader = myCustomTableHeaderView;
This would set myCustomTableHeaderView as the header of your table view and it would scroll with the table view.
By implementing tableView:viewForHeaderInSection: for section of index 0, you can instead have the header as the first section that should disappear when it scrolls. In this way, it's not a header for the whole UITableView.
If you only have one header for the whole table, can't you just set the tableHeaderView property?
You might, like me, have been searching for the tableHeaderView property. See this SO question for more info.
You should use Grouped TableView Style and in your ViewDidLoad method, add following line of code:
myTableView.backgroundColor=[UIColor clearColor];
myTableView.opaque=NO;
myTableView.backgroundView=nil;
Also in nib file, you should clear background color of grouped table;
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat sectionHeaderHeight = 40;//Change as per your table header hight
if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0) {
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
} else if (scrollView.contentOffset.y>=sectionHeaderHeight) {
scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);
}
}

can Any one suggest me how to begin with nested scroll view?

I need to keep a scrollview of size our view size,in that large scrollview again i have to keep six image views and six scrollviews.Please,can any one suggest something how to start with it.
Here is the key line of code...
[aView addSubview:nextView];