I am trying to put the background of a UITableViewCell on top before selection and reverse it after.
The reason is that there are Label and images which prevent the selection but it is working where this is nothing but the background.
I tried :
cell.backgroundView.layer.zPosition=10;
cell.layer.zPosition=10;
Unfortunately it is not working.
If anyone has an idea to solve this problem, I will really enjoy it.
Thank you in advance.
I finally found a better way to do that.
I have completely disabled user interaction on every cells before selection. Like that, no need to put the background in the first z-Position.
I used the following method at the creation AND the didDeselectRowAtIndexPath method:
cell.cellView.userInteractionEnabled=NO;
I put YES on the didSelectRowAtIndexPath method.
It works perfectly.
Related
I have a UICollectionView filled with some cells, and i implemented the method - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
This works like a charm, but it doesn't work while it is scrolling. It is a problem since the scrolling is very sensitive, and thus when i mean to push a cell and call the method, i end up scrolling with no result.
So i was wondering how to counter this and came up with this:
Can i simply set the method to respond while it is scrolling?
If not - Can i simply make it so scrolling ONLY happens if you use for example 2 fingers? to seperate the 2 actions more.
Thanks on advance
The selection of a UICollectionViewCell happens when you tap it. A tap should be short and at one place. If you scroll instead, you're probably not tapping right. If this is the case, it would also happen while using built-in apps like Mail.
The UICollectionView uses a UITapGestureRecognizer to recognize selection of cells. This gesture recognizer doesn't allow specifics settings that might help you out in this case.
You might be able to change the UIPanGestureRecognizer to need 2 fingers, but you should really think about if that's what you want. You'd better use it the way Apple means it to be used, users are used to that.
That said, here's the documentation page on collection view's gesture support:
http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/CollectionViewPGforIOS/IncorporatingGestureSupport/IncorporatingGestureSupport.html
You might be able to use this to change the minimumNumberOfTouches property of the internally used UIPanGestureRecognizer. But again, I don't think you should.
I´ve got a TableView with a Searchdisplay and when the user tabs on a cell, the cell accessoryType toggles between none and checkmark. That works fine, when i´m using only the tableview. But when I select a cell while i´m using the searchdisplay, the selection won't be applied to the "normal" tableview.
Maik
can you show me or tell me which type of data you are showing on table. and are you using a simple array? i have a method for solve this problem.
NOW i give you a tips when set chekmark you need to make changes in orignal array.How?When will you explain it. Then i can give you good method to do this.
I have an NSOutlineView with a custom datasource (I don't know if this is relevant).
I have only one column (again, I don't know if this is relevant) and I want to perform a specific action upon cell selection, so I thought I should override outlineViewSelectionDidChange. This what I did:
-(void)outlineViewSelectionDidChange:(NSNotification *)notification
{
NSLog(#"selection changed");
}
But this is not working. I have been playing around in IB with the Outline View, the Table Column and the Text Field Cell properties but so far I had no luck. I don't know if I changed any property that caused this situation or if this is something specific to my specific implementation.
So, anyone's got any clue on what I may be missing?
EDIT: Just in case I'm mis-interpreting the selection concept within an OutlineView, I expected the cells to be selected if I just click on the text outside the area of the expand arrow.
Well after a long struggle, as always, just after I posted my question, I found the answer. The problem is I am using the NSOutlineView in an NSPanel and somehow the NSPanel is not allowing the cells to be selected. If I just move the NSOutlineView to an NSWindow it works just as intended.
I need to make UI like following:
In response to a HTTPRequest, I am getting JSON response.
Title & Some HTML Content.
I fill UITableViewCell with the title i get in response.
Now, I need to display the HTML Content in a dropdown manner, with UITableViewCell. Means, on tapping on cell It appears below the cell (or say, in the cell) and tapping again will make it disappear.
I am thinking of making UIWebView, a part of UITableViewCell. Any guidance on how to achive that.
And also, Is there any better way to perform this?
As you asked, "And also, Is there any better way to perform this?"
Not better I can say, but
In my case, I did it using different approach.
on didSelectRowAtIndexpath: I set up new UIWebView and showed the HTML content in it.
I really searched the web for setting the height of UIWebView dynamically, as per the content I am getting through WebResponse. But, I didn't found anything useful, really.
You can try dynamically inserting and removing custom cell which holds UIWebView below cell you select on didSelectRowAtIndexPath:. But I strongly suggest you find a way to convert HTML into string (NSAttributedString, for example) and show a label. UIWebView is known for killing performance.
I have a UITableView with around 10 cells, placed in a view controller in the middle of a program. When I run the program, the table view shows. But if I start quickly selecting random UITableViewCells, the program crashes. I don't know how this is possible because I can do it in another application with a UITableView and nothing interesting happens. How????
EDIT: Nevermind. I fixed it by removing some unnecessary statements.
Check with your coding.May be you have done some silly mistake at the time assigning text to the cells are some where else. Look into your coding.
For your reference you can refer this link.
http://iphonesdevsdk.blogspot.com/2011/04/uitableview.html