i want to fix my table view while i am scrolling [closed] - iphone

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
while i am scrolling my table view gets moving upwards ..
i hav created table view programmatically without using IB so i should able to fix the position of table view while scrolling also...
how to do this..
any suggestions appreciated..

Do you mean you dont want the table to scroll at all? If so then this should do it.
tableView.scrollEnabled = NO;

Are you embedding a UITableView in a UIScrollView? It sounds like it. Don't. UITableView is already a subclass of UIScrollView and supports scrolling on its own.

Related

How can i Stop UITableview cell reloaded While Scrolling the UITableview in iPhone..? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have already tried to implement UISwitch in the tabeleview cell,now the switch state is automatically changed while i scroll and change the view ,
Please guide me....
You can use NSMutableDictionary for holding the information regarding particular cell UISwitch object. If you have enable a UISwitch button for a cell then set Bool yes and tag value as well in the NSMutableDictionary.
Enable the switch for a particular cell object according to NSMutableDictionary values in cellFor rowAtIndexPath.
UITableview reuses the cells, to solve your problem you need to create NSArray for switch states and assign as user scroll up and down (Using NSIndexPath).

Track Finger Touch on UIButton and execute it's action [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have a view with several UIButton instances. Now I'd like that the user can trigger als button when he wishes over it with a long touch. So he can either touch one button or wishe over several buttons. Therefore all button actions of the touched buttons should be executed.
Here's a photo (buttons with red background color and black border):
Thanks for your help!
Best regards from Bavaria,
Chris
If I understand the question right, what you need with your grid of buttons is UIPanGestureRecognizer.
You can add the same recognizer to every instance of UIButton and handle all its states (UIGestureRecognizerStateBegan, UIGestureRecognizerStateChanged, UIGestureRecognizerStateEnded).
If you want certain delay in detection (like UILongPressGestureRecognizer), you can trigger timer and check if finger is still inside the UIButton's frame.

How to stop scrolling of row of UITableView inside of header UITableView [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
When I am scrolling vertically row is going inside of headerview of table, how will change to stop going of row inside of header of UITableView. I have some important view which should show always top of UITableView and if user scroll it should hide as row hides.
Going row in top header should also go on top.
I mean it should show attaching headerview with first row.
keep numberOfCell
array.count+1
In cellForRow method
if(indexPath.row == 0)
{
//create your cell as header and return
}
else
{
//return normal cells
}

Orientation with multiple view controllers [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is it possible to have the following?
When I rotate my iOS Device, the ViewController switches, as in I have RandomViewControllerPortrait and RandomViewControllerLandscape. I have the feeling that if I support both orientations, that the ViewController class gets quite "bloated".
Is this idea useful at all?
I think having 2 view controllers for different rotations would be a bit redundant. I think what you want to use is 2 different UIViews for different orientations, and your UIViewController handling the methods for rotations being called. When your application rotates, you can set self.view to be either portraitView or landscapeView. You can even animate the view change with an animation block, so the transition looks smoother.

What are your favourite UITableView / UITableViewCell tricks? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
UITableView is a very powerful class, powering many navigation and preference views on iPhone. Many people have come up with useful UITableView tips, tricks and samples:
various ways to use Interface Builder for table cells
how to create preference-style cells
ensuring good scrolling speed
etc.
Please post your favourite tips on using UITableView, one tip per question. I'll start by posting the ones I found on Stack Overflow and the ones from my bookmarks.
Ever wondered what UITableViewController really does?
In viewWillAppear, it deselects any selected rows, with animated:YES.
This by the way is why when you navigate back in UINavigationController, the row you've previously touched is nicely deselected with animation. When you pushed a new view controller onto UINavigationController, you've left the row selected. When you pop it and go back to the table view, viewWillAppear fires and deselects the row. UINavigationController does not even know about this happening.
In viewWillAppear, it calls reloadData if the table view contains no rows.
In viewDidAppear, it calls flashScrollIndicators.
It monitors the keyboard appearing and disappearing and resizes the table view appropriately so that when you tap a text field in a table view, it remains visible after the keyboard appears.
If you don't need the keyboard monitoring behaviour, it is fairly easy to do everything else yourself if you need to.
Implementing “checkmarks” in editing mode to manipulate several rows at once: “Multiple row selection and editing in a UITableView” from the great Cocoa With Love blog.
How to implement a custom cell background view?
An excellent sample class by Mike Akers in “How to customize the background/border colors of a grouped table view?” on Stack Overflow.
If you want to remove the separator lines, use this:
[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
To ensure good performance scrolling, it's important to avoid transparency in any element if possible - so if you are creating custom cells make them all opaque and set the backgrounds correctly.
You can use the Core Animation Performance Tool to visually see how much transparency you have going on in a cell - you have to be running on the device to use this tool.
Implementing Preferences-style grouped tables: Three20 library (extracted from Facebook iPhone app) has a set of ready-made cells that contain various controls.
(Not sure you want to use them, however. Three20 suffers from “not-invented-here” a little bit and tries to subclass and extend everything, so adding it adds quite a bit of a mess to your project. But at least you can use it as an example.)
How to use Interface Builder to author your cells? Find answers on a separate Stack Overflow discussion: “Using Interface Builder for UITableView’s”