How to interact with a UITableView displayed overlapping another UITableView - iphone

I have one UITableView displaying some data, and when the user begins typing in a UITextField above the UITableView, another UITableView is displayed below the UITextField to show suggestions. This "suggestions" UITableView overlaps the UITableView below the UITextField. Tapping on one of the suggestions will populate the text box with the item tapped.
The suggestions UITableView displays in front of the other UITableView, but problem is that none of the taps to the suggestions UITableView register if they're outside the bounds of the view that contains it.
This is probably a really simple problem dealing more with UIViews in general, but I'm having trouble. Thanks for the help!

You have to adjust your second tableview which is giving you suggestions below testfield which will solve most of your issues
hope it helps you

you can show the second UITableView within another view that is displayed above the current view, like a popover, using
[self.view addSubview:secondView].
Once a selection is made, you can remove this view using
[secondView removeFromSuperview];

Related

Implementing a dynamic height on UITableView

I have a UITableView embedded in a UIViewController. The TableViewCells are rows for the user to select something, so when they touch it a checkmark appears, heres where my question comes in:
I dont want the UITableView to scroll in its window, I want the TableView to grow with the items it contains. Do I need to put a scroll view on the UIViewController and then the TableView on that? Or will the ViewController scroll if the content is bigger than the View?
Also, Im not even sure where to start with changing the height dynamically of the UITableView, everywhere I look its about changing the cell heighets dynamically.
Please Help! Thank you!
self.tableView.scrollEnabled=false;
stops the scrolling
self.tableView.frame=CGRectMake(0, 0, (float)width, (float)height);
sets the size of your tableview
But I don't understand why you want to stop tableview scrolling and to scroll the whole view....

How to scroll to UITextField placed into a UITableView

I've got an UIScrollView with an UIImageView at the top and an UITableView.
inside every cell of the UITableView I've placed a UITextField
I would like to know how I can automatically scroll to the UITextField selected so that it doesn't go under the keyboard
I've already looked at this Get UITableView to scroll to the selected UITextField and Avoid Being Hidden by Keyboard but it doesn't works very well for my situation..
could you help me?
Thank You!
Check out Matt Gallagher's fantastic Sliding UITextFields around to avoid the keyboard. It ought to be just what you need. You can modify it to only scroll a specific element, or just leave it as is to scroll the whole superview.

Allow input in a UITableViewCell

So I have a UITableView (its in a UIPopOverController if that matters), and I want the user to be able to edit the content of the tableView. I added a UINaviagationController, the tableView also has a title and an edit button. Essentially what I'm asking is, when the user taps the edit button, how can I add like UITextViews to some of the tableViews and in one of the cells, a UISegmentControl and a UITextView.
Thanks in advance
just add them as subviews of the cell, set correct frame to make subviews inside the cell

Manually scrolling UITableViewController when a UITextField becomes first responder

Harrr pirates!
I'm trying to make a data entry screen using a UITableViewController. It contains a grouped table view with two sections, each with a few (2 and 4) rows with a UITextField inside them.
When any of the UITextFields become first responder they scroll into view automatically. Great, you would say, but I want to scroll the whole section into view, not just the row containing the UITextField that became first responder.
I don't allow the user to scroll the UITableView by hand and I know to what position it should scroll to display correctly. However, I can't get my UITableViewController to stop automatically scrolling the UITextField into view for me.
Searching StackOverflow I can find a lot of questions about how to resize the UITableView when the keyboard appears, but this doesn't stop the automatic scrolling.
Any suggestions? Your help would be much appreciated!
TableView is basically an extension of scrollView therefore if you want to do the scroll yourself you should use the scrollview API.
Set the contectSize property to the size of the screen without the keyboard and the contentOffset to the location on the table you want to scroll to

Problem in UITableView and UIScrollView

My table has more than 10 rows with 50 row height....so i can't select my last row....so i have set UIScrollView and add this table into UIScrollView.
Table display perfectly but which rows are displayed in UIScrollView, these are not selectable.
How can i get this row selecablt in UIScrollView. If anyone body know then pls tell me wha to do?
Thanks,
Haresh.
Putting a UITableView inside a UIScrollView won't work, beause UITableView is a UIScrollView. You're going to have to work out why UITableView won't scroll properly for you on its own.
Check how you initialize it and look at some of Apple's example UITableView code to see what is different.
It may be that your navigation bar, toolbar or some other control is hiding that last row. Check to make sure the tableview partly under another control.