views:

277

answers:

1

I'm pretty sure I saw an example where the graph wasn't filling the whole iPhone screen, but I can't get that to happen in my app, nor in the Core-Plot Test app from Switch On The Code.

I've added a subview to the original CPLayerHostingView in the sample, then changed the classes – original back to UIView, new subview to CPLayerHostingView, and I've reconnected the File's owner's view outlet to the new subview.

When I create a graph with:

graph = [[CPXYGraph alloc] initWithFrame: theSubviewOutlet.bounds];

… and step through the first stages of building up the layers the bounds are accurate (i.e. the same as in the .xib)

however, when all the initialization is done, and the graph shows up, it fills the whole superview.

Am I missing something obvious?

+1  A: 

These types of questions are better asked on the core plot mailing list, because we may miss them over here.

There is nothing special about a CPLayerHostingView. You should be able to add it as a subview to your UIView, and resize it as you wish. You should also be able to set springs and struts in interface builder, or via code.

Perhaps you have your parent UIView setup to resize subviews in some way? In any case, Core Plot should not be doing anything to modify the host view frame.

Drew McCormack
Thanks for the tip on getting help on the mailing list. My problem was a bozo mis-config of the .xib.
Robb