UICollectionViewCells in second column are not responding - ios

In my application, I have used UICollectionView:
Inside the collection view cell, I have a view button.
If we click on that button, another view will be opened displaying the details of the graph and an enlarged image.
The problem is that if I click on the view button in the cells present of left column i.e. first column everything is working properly, but if I click on the view button in the right side column or 2nd column cells, the detail view does not appear and they become unresponsive.
I do not understand the problem. It is working well for left side cells, then why is it not working for right side cells?

Check your view dimensions and make sure that collection view is not overlapped with other views, it seem that it is not recognisisng the ui gestures at those points..

I got the problem, the problem is i am adding the collection view to a subview named display view and then adding to the parent view, but the main screen frame width is less than the collectionview so the uievents are not recognised at that column part, so i have deleted that display view and added the collection view directly to the parent view and now it is working..

Related

indexed UITableView as Part scrollable Page

I'd like to implement an Interface that shows an indexed UITableView. In the table view I want a view displaying labels and image views related to the table view.
Together they should behave as if they were on one scrollable page.
First I tried to solve the problem with a tableHeaderView (not a section header). But the problem is that the section index overlaps the tableViewHeader.section index overlaps the table header view
If have seen approaches to solve a similar problem with a UISearchBar, but I can apply them to me problem
Then I tried to embed the tableview as a container view into a container viewtable view in a containerView
The problem here is that you can scroll the tableView inside of the container View, while the top view is still visible.
I also though about fading the index in when the content offset is equal to the height of the top view. But there seems to be no official way to get a hold of index bar view.
Any ideas?

UIButtons not working in Scroll View

I have a Scroll View with a View (content view) inside of it. I've added two buttons to test. The Scroll View scrolls fine but the buttons within the content view are not clickable. I've seen plenty of posts saying this issue happens when they programmatically add UIButtons to the View, but I am not doing this. Here is my exact process:
Drag the Scroll View onto the main view. Add 4 constraints
Drag the Content View onto the Scroll View. Add 4 constraints.
Add 2 Buttons (one high and one low to test scrolling) to the Content View.
This is all I am doing, no code at this point. Is there anything else I have to do to allow the buttons to be clicked? Here is a screenshot of my xib:
Update:
When hooking the button up to a simple IBAction and logging a message, it turns out it IS being pushed and working properly. However, when the button is pushed, the button isn't changing colors like it should (its "pressed" state is not appearing). Any ideas why?
First make the button to custom type
Select button from storyboard then on right attributed inspector change its "state config" to whatever you need like Highlighted, selected, Disabled and default and choose the colour for each state.
Now you can see the colour change on that button.
A UIScrollView first needs to know whether or not you are going to scroll before letting the touch pass to its child views. If you want the child views to get the touch immediately, set the UIScrollView's delaysContentTouches to NO.

iOS app shifted right and can't view full table

I'm having trouble setting a layout for my iOS app. The entire app is shifted right for some reason as you can see by the label and buttons which are in the middle of the scroll view.
I also can't seem to display the entire table. In the screen shot below "another Item" is supposed to have a checkmark and it is only visible if I shift the table in Main.storyboard far to the left where the actual label for the cell item is half visible.
I have a scroll view inside of the view controller and then a label and three buttons as well as a table view with table view cells.
Thanks to Lucas for the answer
Are you using Auto Layout with that storyboard? Looks like you might not have set your constraints up properly. You might also want to take a look at Xcode's new View Debugging functionality.

iOS Autolayout - black screen when adding view above table view

I have UIViewController with UITableView which fill entire screen (I am using auto layout). When I add some view to the view above table view sometimes when I push to this view controller I see black screen, but only in the place where should be table view. Sometimes when I remove the view and add other then works sometimes not. So I have no idea why sometimes works sometimes not and what can cause thsi error. I can even add only IBOutlet to the one of the constraints and then I see black screen, if I then delete the view with this constraint, then works and if I then click undo and the view comes again, then works. I don't undernstand it.
Can someone help me?
The default tableview background colour is black so it may be that you're table isn't being populated. Try setting the bg colour of the table view to something obvious (e.g. red) and also check your datasource is available when the table is trying to layout.
Sorry, it was my error I didn't notice. I set view of my view controller to tablew view in the interface builder.

How to get UITableView header view to come before table cells in responder chain?

I have a rather large table header view above my table view. I have a number of subviews in that header view. I am doing something a bit nonstandard where I am "sticking" some of those subviews (but not all) at the top of the table view.
My problem is that although visually the table view cells pass under the sticky table header subviews, it seems that the table view cells are "above" the table header view in terms of touch response. (For example: I have a button that is a subview of the table header view. When there are no cells underneath the button, the button works great and responds to touches. However, when the user scrolls the table view so that there are cells underneath the button, a touch on the button actually selects a hidden cell rather than push the button.) Can anyone give advice on how to "raise" the table header view above the table view cells, so that its subviews get first shot at touch handling?
I am using a table header view rather than a section header view due to the fact that I only want some of the subviews to stick (letting the others scroll up off the screen as usual). One of the subviews also can be expanded (and that expansion is animated) - to a height that is even bigger than the entire height of the screen. For these reasons, I didn't think using a section header view would be feasible. (If it is, please let me know, as I know that section header views are "above" table cells when it comes to touch response.)
You may try this, which would keep the desired header view on top of the others.
[yourView bringSubviewToFront:yourSubView];
This may be able to help as well:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/5222-keeping-subview-front.html
Is this what you were looking for or did you want another approach?

Resources