Is it possible to have a small UITable in a view, where when you click a cell, the small table is transitioned to the detail level? I currently have it so that the whole screen slides to the detail level.
thanks
Instead of creating a UITableView/UITableViewController, create a UIView/UIViewController and drag-drop the UITableView to your UIView. Set the size and position of the tableview as you want and make the UIViewController the tableview's delegate and datasource.
What you have to do is create another view controller and lay it over the top.
to make a UITableView co-exist with a UINavigationController you have to create a transparent view to hold it. the view will be fullscreen so it does not resize the embedded UITable
Related
I have a UIToolbar that I added to a UITableViewController in my Storyboard.
When this view is displayed, the toolbar will show itself directly below the last item in my UITableView. I want to "Dock" my toolbar on the bottom of the screen. I want it to display in the same place every time rather than move around depending on a variable number of table cells in my view. I need the user to be able to see all the cells as well (It can't be covering UITableView items, UITableView needs to decrease its allotted display space). How can I do this?
Edit: Using a UINavigationController to handle my views
You have a couple of options. The first and easiest of the two would be to use a UITableViewController embedded inside a UINavigationController, with the navigation controllers toolbarHidden property set to NO.
The other option is to use a UIViewController. A view controller has a UIView build in, and you can manually add and position a UITableView and a UIToolbar on it in this configuration. Both of these configurations will achieve your desired end result.
I created a MasterViewController project with a tableView, now I'd like to add some tabs to this. I tried to just drag and drop the tab bar into the MasterViewController and the tabs show, but they are linked the the last cell in the tableView.
Is there any way to make the tabs stay in place so they are always displayed? What I am trying to accomplish is to give the user buttons to push to organize the data in the tableView, so I'm open to other suggestions.
Here are the pictures:
You need to have your controller be a UIViewController, not a UITableViewController (where the table view is the controller's self.view, and is full screen). If you use a UIViewController, you can add a table view, and size it such that you have room at the bottom to add the tab bar. In that case, both the table view and the tab bar are subviews of the controller's self.view. The way you're trying it, the tab bar is added to the table's scroll view.
It sounds like you added it as a subview of the table view, so as the table view scrolls it scrolls too. Look at creating a container view to hold both the tableView and tab bar / segmented control / buttons positioned below it. You will need to make the controller a subclass of UIViewController instead of UITableViewController.
Alternatively, use the navigation bar to add some edit button(s), either to enter an editing mode which shows controls on each row or where the buttons actually edit the currently selected row.
Tab bars are container controllers and are used to present a different mode of your application. If you want to only organize your tableview data, my suggestion is to use UISegmentedControl.
I have a screen where I want to display the details of some product. I'm using storyboards.
I have done this using a tableview with static cells, but static cells can only be done within a tableview of UITableViewController. And the problematic point is that I also want to have a Imageview within this controller. this is not possible as the tableview of a UITableViewController take all the screen size.
So I'm doing the Imageview as a subview of the tableview.
I'm wondering if it is the right way to do it, there are similar issues on stackoverflow but none is corresponding to my use case (storyboard + tableviewcontroller + staticcell + sub view)
Without writing any custom code, you could either:
Put a UIImageView in the table view's header or footer view.
Create a static cell and put the UIImageView in that. Table cells don't have to be uniform length, you could make it taller than the other cells if needed.
You can have your subclass of UITableViewController. After you initialize it take its view (tableView) and add it as subview to some other view controller. This way you can set the frame of tableView to occupy the bottom of the (top containing) view controller. To the same view controller you can add additional subviews like UIImageView and position it on the top. The only problems you will encounter might be related to missing notifications to your UITableViewController subclass (viewWillDisappear, viewDidDissappear, viewWillAppear, viewDidAppear, ...). But you can forward them to from your top view controller. Or you could use methods from iOS 5 to add subclass of UITableViewController as a child view controller and position it as you wish. But this is useful if you plan on supporting devices with iOS 5.0+.
See documentation of method in UIViewController:
- (void)addChildViewController:(UIViewController *)childController __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0);
Use a UITableView as a property of the viewController and add it to vc.view, rather than subclass a UITableViewController, then set its frame as you like
Add the imageView to vc. If you need to put it on top of the UITableView, for example, add it as the TableView's header.
Is it a Segmented Control?
About the featured view, is it purely a tableview? how could they make the Segmented Control to be permanent instead of scrolling with the table cells down below?
as Ertebolle says its a UISegmentedControl set as the titleView of the navigationItem.
You can also create elements within the view that don't scroll with the tableview by adding a UITableView as a subview of a UIViewController's view. Setting its frame property means that you can have a scrollable tableview in a fixed certain position in your view and other elements in the view that don't scroll with it.
Yes, I believe it is a UISegmentedControl. But it's set as the title view of the navigation bar - to reproduce the whole effect, you'd create a UINavigationController, push a UITableViewController as the top view in it, and set the titleView of the table view controller's navigationItem to that segmented control. This would automatically anchor the toolbar / segmented control on top.
In a view of my app I subclass tableViewController and has an activity indicator shown up when the table content is loading. I put it in the center of the screen but it scroll with the tableView (I guess the reason is I add it as a subview of the table view). Is there a way that I can keep the activity indicator in the center of the screen even the table is scrolling?
You could either subclass a UIViewController instead, and set a table property, adding a UITableView as a subclass to the UIView, making it behave exactly like a UITableViewController.
Or, more simply, you could just add the UIActivityIndicator as a subview to the main window.