trouble in scrolling in uitableview - xcode

I've created a Tableview populated with cells with a fixed tableView.rowHeight = 95.0
The problem is that when I add more cells and I try to scroll to the bottom, I can see only half cell at the bottom. I mean, when I try to scroll I can't scroll down so that to see the entire last cell added.
Seems the scrolling bar doesn't work well. Is this a bug of Xcode or did I make something wrong?
I don't want a resizable height cell but I want my cell fixed with with 95.0 but at the same time I want my scrollbar to work better.

The problem is if the table height exceeds the your mainview. At that time srollview of tableview also goes down.solution is keep the tableview height within the bounds of mainview(i.e your viewcontroller's view)

Related

xcode - UILongPressGestureRecognizer not work on hide element of scroll

I have a subview of a scrollView where there are some images. That images have the UILongPressGestureRecognizer property.
Opening the view, there are some images visibles and others that are not visibles. To show them, scroll is needed.
The problem is that GestureRecognizer action works well on visibles elements of the subview but not on elements that appear when user scroll. I verify that:
- (BOOL)gestureRecognizer:(UILongPressGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
is called only when visible immages are touched, but not on the images hided by scroll.
User interaction are enable both on scroll and subview where elements are.
Any help will be appreciated.
After some days, I solved the problem.
In my case, when I adjust the height of the subview to the table, I was using the table frame size.
[mySubview setHeight:myTable.frame.size.height];
so the gesture recognize was hided from the dimension of the frame.
Changing with the content size
[mySubview setHeight:myTable.contentSize.height];
it works.
I hope it helps.

UIScrollview scroll not working

UIScrollview scroll is not working when i tested application in device (iPhone 5), But scroll is working properly in iPhone 5/5s/6/6 Plus simulator. I am developing application using Xcode 6 and UIStoryboard with AutoLayout.
I set the top, bottom, left and right constraints of UIScrollview with relative to Superview. And i also set the constraints of every UIControl which is in the UIScrollview.
Has any one have solution regarding this issue?
Please see below screenshot for reference.
It's probably easiest to have the scroll view contain a single view, which then contains all of your scrollable content. That single view should be anchored to all 4 sides of the scroll view, and if it's only meant to scroll vertically (which is what your screenshot makes it look like), then set the content view to be the same width as the parent of the scroll view.
To make sure an UIScrollView scroll, you have to check
Size
Your content View is bigger than your Scroll View. If you want it to be scrolled vertically, make sure its higher; horizontally, wider.
Constraints
Make sure your Scroll View is pinned to its super view, Top, Bottom, Leading, Trailing.
Make sure your Content view of Scroll View DOES NOT have CenterY constraint set to Scroll View, cause that'd make content view stuck with Scroll View and it'd never be able to scroll. (That happens to me the last time I was stuck)
Interface Builder settings
Make sure the check in Interface Builder under Scroll View is checked:
Scrolling section, Scrolling Enabled.

NSCollectionView inside NSTableCellView doesn't resize

I want to show a NSCollectionView inside a NSTableCellView. I have it setup correctly, and it works for the most part, but the collectionView's scrollview doesn't seem to resize properly against the NSTableCellView, even though I have auto-layout constraints setup for this.
Is there anything I can do to setup constraints in a way that the scrollview resizes against the NSTableCellView (which should also let the collectionView also resize itself)?
EDIT:
To elaborate, what I really want to do is have the collectionView expand and resize as the window is resized, and have it take up the same width as the tableViewCell, and depending on the number of items in the collection view, resize the height of the outlineView & hence determine the height of the outlineView's row. It works fine when the collectionView is part of an ordinary view, but I can't get it to resize itself inside a NSTableCellView.
Firstly, remove all of the constraints you've set for your collectionview/scrollview.
Now, you will need to make 4 constraints, one for each of the leading, trailing, top and bottom space from the scrollview to its superview. Make sure width and height are not constrained. I've done this in a recent app I've made and it worked rather well.
EDIT: Below in the comments we figured out the column wasn't resizing so the constraints were correctly set.

UITableView cannot scroll

I have a tab bar, and two of the tabBarController.viewControllers has tableview inside.
When I launch the App. tab 1's tableview cannot scroll. When switch to tab 2 and switch back to tab 1. the tab 1's tableview can scroll.
So strange! Can anyone give a hint?
Is it related to number of rows? p.s. both of tableviews' frame is not filled with enough rows.
Thanks.
Does the tableView bounce? It should do this regardless of the number of rows.
Sounds like a problem with the bounds of the tableviews superview - if you set clipToBounds on the superview and the tableview disappears, then thats it.

NSOutlineView badges in NSSplitView

I have an NSOutlineView which I draw badge numbers to the right side of cells using drawAtPoint:, NSAttributedString, and of course NSBezierPath. My problem exists when resizing of the outline view occurs when within a subview of an NSSplitView. The badges move along with the resize to the left or right. When they get to the text of the cells themselves they do not stop or truncate the text under them. It just flies right over.
Is there a way to have the cell recognize the custom drawn view next to it and truncate text accordingly? I have tried the solution PXSourceList already, but that did not help either.
"PXSourceList solution" working good. You subclass NSOutlineView and overload frameOfCellAtColumn for this particular task. At this function you need to decrease width of cellFrame, returned from super call, by the width of your badge plus padding.

Resources