UITableView in table view's headerView - xcode

Relating to UITableView sections to always stay within view but I got an idea I'm not sure of:
Has anyone ever tried to nest a UITableView in another UITableView, whether by putting the second one as the tableHeaderView or as a section header of the first one?

UITableView is derived from UIScrollView. It is generally not a good idea to have a scroll view inside a scroll view (exception: when the scrolling directions are perpendicular to each other).
Otherwise you would end up with a user interface that is not appropriate for most users.

Related

NSSplitView Holding Priorities not shown in IB, why?

I am puzzled and could swear I set my NSSplitView holding priorities in IB some days ago, but now they don't seem to be visible in IB at all. Does anyone else see holding priorities in the top left of Xcode's IB when the splitView is selected ?
Does your split view have subviews? I can reproduce what you're seeing if I delete all subviews from a split view. That section shows one slider for each subview.
Update:
You are using the new NSSplitViewController and NSSplitViewItem classes introduced with Yosemite. Because of that, your split view does not, in fact, have subviews in the NIB. (There's no triangle toggle to disclose subviews under the split view.) The split view items will provide views on demand via their view controllers.
The holding priority is a property of the split view item. I can't verify at the moment, but I expect that Xcode will provide a means to set it if you select the individual items.

UIPage Control custom style NatGeo

In my app I have UIView that flow through the use of a horizontal scrollView. To scroll the view I used the classimo method [self addChildViewController: [self.storyboard instantiateViewControllerWithIdentifier: # "name Storyboard ID"]];
Each UIView is followed through the use of UIPageControl classic, but I do not like it and so I wanted to create something like this (see photo)
as you can see from the images above application there is a menu with a triangle pointing down, Indicating the page, passing from one topic to another user through the horizontal swipe on the scrollView
In other words, instead of having the classic shot for the management of the pages, the National Geographic has used a triangle pointing down and the title of the page on which the user is ...
Could someone help me understand how can 'be created a similar PageControl?
There are a lot of approaches to implement this. Maybe the custom PageControl won't be the subclass of a UIPageControl.
For example, you can subclass a UIView, and put a UIScrollView in it. And then put a bunch of UIButtons in a row into the UIScrollView, each of them has a title that is your page's title. When you tap a button ( you can get this event by UIButton's -addTarget:action:forControlEvents:), you can scroll the tapped button to the right position, highlight it, and put a little triangle below it.
There are many possibilities. Say, you can replace the buttons with UILabel and add UITapGestureRecognizer to capture the users tap, or you can replace the UIScrollView with UITableView if you get a long list of pages(Of course that will introduce some complexity). You just need to pick your favorite and try it out.

Xcode Table View sections without using TableViewController

I have a special thing to realize here.
I have a ViewController with a View on it. On the View I have an ImageView (I need a nice Background-Image) and many Buttons and Textfields and so on.
Now I need a Tableview. This Table view is located in the center of the screen.
I need sections in this tableview, so when I edit it to have sections its complaining,
because he wants a TableViewController to use static cells and sections.
Here's the problem. I cant use a TableViewController cause I need this stuff around
the tableview (those buttons and textfields) and I also need the image in the background.
So how can I realize that?
Interface Builder doesn't allow static cells in a table view that's embedded in a view controller. You need to have the table view's datasource point to your UIViewController. The view controller should hardcode the values/configuration for the cells. It's essentially the same thing... you just don't see the results until you run the app.
Also see this question Using static cells in a storyboard UIView with Xcode 4.2

NSView added as subview doesn't show

I have a puzzling problem. Working on a cocoa app in mac os x 10.7.
My app main window contains a split view. In a certain use context in one of the subviews of the split view is loaded a custom view with some labels (nstextfield) and a split view (instantiating a view controller that loads a nib and getting view from that controller). Frame of the custom view is set to split view subview bounds and everything works fine.
Problem is that one of the subviews of the second split view should be loaded (same method: view controller-nib-view-frame/bounds) with a custom view containing a table view and a button, but in this case nothing shows. Everything is done the same way but last custom view is not visible. Any idea?
Thanks
(edit)
this is the code I use to instantiate controller for the view to be added, get the view, and add it as subview to a subview of the split view
- (void)loadSubview {
self.subviewToAddController = [[viewController alloc] initWithNibName:nil bundle:nil];
//nib name is coded in the controller class definition
[[self.subviewToAddController view] setFrame:[self.splitViewContainerSubView bounds]];
//container subView is an outlet
[self.splitViewContainerSubView addSubview:[self.subviewToAddController view]];
}
However I don't think the problem is in this code because if I ask the container subview for its own subviews I can see the new subview is present in the list. It just doesn't show. If I add it as a subview of the split view (a test a just made) or as subview of the subview of the most external split view it is correctly showed too (sorry for the confused explanation, I would need a diagram but in this moment I can't make it)
To elaborate more my doubt (I didn't want to misled so I didn't mention before) can't it be a problem of coordinates, so view is correctly loaded and added as subview but is not visible because hidden by something or showed out of visible area?
(update)
Sorry it took so long to post an update.
After more testing I found out the problem is related to autolayout. No idea what the exact problem is and how to solve it. I ended up turning it off for the nibs the were in troubles and use the old way to set interface objects position and size/resize. Not the best way but for now I can go on.
My best guess is that you didn't set the autoresizing masks of the view properly.

iPhone - UIScrollView with Interface Builder

i have to set some objects like UILabel and UIImageView in my scroll view from Interface Builder. But, how can i do?? I know that this can be done from code, but for a multilanguage app is too annoying :)
EDIT:
I solve the problem!
I explain again and better the problem : i had to "draw" my view with UIScrollView with Interface Builder because is the easiest way to manage multilanguage view. First, we have to add UIScrollView in our view. But in this case we don't be able to insert objects in a point that have height > 460. So, i've added a scroll view, but not in my view and i've modified its height and i now add objects everywhere i want.
Try to be more specific. What problems did you encounter? Generally all you need to do is to drag&drop your outlets in the scroll view (and optionally bind them to IBOutlet fields you may have in your controller class, according to what you need to do).
I solved the problem! I explain again and better the problem : i had to "draw" my view with UIScrollView with Interface Builder because is the easiest way to manage multilanguage view. First, we have to add UIScrollView in our view. But in this case we don't be able to insert objects in a point that have height > 460. So, i've added a scroll view, but not in my view and i've modified its height and i now add objects everywhere i want.

Resources