简体   繁体   中英

How to add UIView to the CorePlot view?

I have a UIView for CorePlot and I want to add UIView under the plot as a subview. I have tried this:

[self.view bringSubviewToFront:_viewTable];

But it doesnt work. How can I make it work?

EDIT:

My Storyboard:

在此处输入图片说明

Green - firstPieChartView (CorePlot view)

Red - UIview with tableView

In viewDidLoad:

[self.firstPieChartView addSubview:_viewTable];
  [self.firstPieChartView bringSubviewToFront:_viewTable];

You are bringing the view to front by this, not adding it as a subview. First you have to use:

[self.view addSubview:yourSubview];

--in order to add it. Then you can bring it to front, if you're overlaying it with other subviews.

Do not add subviews to a Core Plot hosting view. The iOS hosting view applies a flip transform to its children so Core Plot can share drawing code with the Mac version. Instead of making your view a subview of the hosting view, make them siblings (ie, children of the same parent view).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM