iOS9 Wrong separator insets in custom UITableViewCell - ios

I want to change my custom uitableviewcell into autolayout under xcode7 with iOS9.
Subviews in cell are well autolayouted.But the separator line always have a huge right insets.
I've tried setLayoutMargins, setSeparatorInset, preservesSuperViewLayoutMargins, cellLayoutMarginsFollowReadableWidth. But they didn't work at all.
Anyone has the same issue?
Thanks.
Update:
My xib file is built since iOS7. Is that too old to configure?

I've found the problem.
The reason is that I overidded the -(void)layoutSubviews in mycell.m before.
Comment it, then it works.

Related

UITableView acting weird on storyboard builder

Is there anyone encounter this problem on Xcode 9.2?
I setup the UITableView as shown in the image above. And added a UILabel below the UITableView for demonstration. The image above is in "portrait" and the constraints work fine and ok.
When I change the orientation to "landscape" the constraints seems didn't work on the UITableViewCell although no errors is shown. While the UILabel below the table readjusted as expected it should be.
Anyone can explain this? and how could I possible fix this? It's kind of annoying...
Xcode version: 9.2

Xcode 8 autolayout constraints don't work in custom tableViewCell

I have an app that uses custom tableviewcells. When I use autolayout for subviews (e.g. UIImageView, UILabels) on runtime I dont see any of the subview even though the constraint lines are blue. Everything was fine before i updated to Xcode8.
Constraints work fine on in other views.
EDIT: Here is the screenshot. Imageview is not displayed at all, even though it has placeholder image by default and there are images in source to replace the placeholder.
EDIT: same code without constraints.
I had a similar problem when using custom table view cells and auto layout. Somehow when I called [self.tableView registerClass:[CustomCell class] forCellReuseIdentifier:#"cell"] the cell wouldn't show. However once I removed this line from the viewDidLoad: everything worked properly
It's not certain that you have things layed out this way but this is what worked for me. Also, if you use anything like an autoresizingmask, turn that off for your constraints to work. You could also try selecting the Content View of the cell in interface builder and deselect "Autoresizes Subviews".

UITableViewCell Height Not Setting Up In StoryBoard

I am having a strange issue that i am unable to solve. In my Storyboard, i have set the height of a custom UITableViewCell to be 100.
But when i run the program, the height is not hundred, its 90 and i don't know why. The issue wasn't there until i updated the project to iOS 7. It might be the AutoLayout but Auto layout was already enabled when my app was running on iOS 6 SDK.
Can anyone point out what could be the problem and how i can fix it? Thanks!
Is this the only cell that is supposed to have a row height of 100? If not, I'd try changing the row height attribute of the table view itself.
If this is the only cell, another thing I'd check is if any of your constraints were changed when the project was updated to iOS 7. If you have any ambiguous or conflicting constraints set, they'll show up if you click the yellow/red indicator to the side of the scene in question.
The last thing to check would be if you're calling
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
anywhere. I doubt that's the problem, but you never know.

(iOS7) Scroll to cursor in UITextView in UITableView in UIScrollView

I have a problem since I updated to iOS7.
I have base UIScrollView horizontally and there is UITableView on it
(looks like a navigation style).
And I addChild UITextView on UITableView not on the cells.
And it scrolled to UITextView's cursor when typing keyboard. And it works greatly until iOS 6 but not since updating iOS7.
How can I solve this problem?
Thanks.
Handle textViewDidChangeSelection in UITextViewDelegate:
- (void)textViewDidChangeSelection:(UITextView *)textView {
[textView scrollRangeToVisible:textView.selectedRange];
}
The exact solution depends on your application, you can handle by subclassing UITextView but I would prefer a decorator pattern here (on UITextViewDelegate protocol).
I hope it helps.
Have you created your XIBs in xCode4 and now trying to open it in xCode5?
If yes than please check your XIBs properly as Xcode5 updates older xCode 4.x XIBs and sometimes it results in a unpredicted output.. I faces the same issues when all my views just disappears after opening it in Xcode5..
Also do try to change the settings of the xib in File Inspector to open in xcode 4.x and view as ios6.1 and earlier and see if it changes anything..

UIButton not in the same place on storyboard

I moved all my UIButtons to fit on a particular UIImageView and for some reason they're not matching up the to correct location as the storyboard when run on the simulator nor the iPad itself. It's weird and I'm confused.
This is a screenshot of it in the storyboard.
This is a screenshot of it on the simulator.
Notice how some of circles(buttons) the titles are shown. Why is this happening and how can I get them into the position they are in the storyboard? Thanks for the help :)
Okay, for some reason i disabled the auto layout thing on the storyboard. But, when i reenabled it it seemed to work. Strange bug, but the problem is fixed now. Thanks larme, for making me aware of the auto layout thing.

Resources