core-plot adding UITable
i am still very new to objective c and in fact this is my first attempt to build an app so please开发者_StackOverflow社区 bear with me...
I am trying to add an UITable beside core-plot graph, i have taken CPTestApp example and stated to work off that, i was able to get the graph part working ok but i am having trouble with UITable. Below is the screenshot of how it look at the moment.UITable is upside down and the text is all mirrored..
below is rotation part, can someone point me with an example for UITable rotation together with graph...UITable is populated with an array of values and that is working ok too..
i probably need some guidance to figure out the correct way to add UItable to the coreplothosting view layer
Thanks
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if (UIInterfaceOrientationIsLandscape(fromInterfaceOrientation))
{
// Move the plots into place for portrait
scatterPlotView.frame = CGRectMake(20.0f, 55.0f, 728.0f, 556.0f);
tblSimpleTable.frame = CGRectMake(20.0f, 644.0f, 728.0f, 340.0f);
[tblSimpleTable reloadData];
}
else
{
// Move the plots into place for landscape
scatterPlotView.frame = CGRectMake(20.0f, 55.0f, 858.0f, 677.0f);
tblSimpleTable.frame = CGRectMake(878.0f, 51.0f, 220.0f, 677.0f);
[tblSimpleTable reloadData];
}
}
Core Plot applies a flip transform to all of its Core Animation layers so that the drawing code can be shared between iOS and MacOS. This is what you're seeing.
Make sure your UITable and graph hosting view are siblings (i.e., have a common parent view) and one is not a subview of the other.
精彩评论