饼图在iPhone中不显示内部滚动视图

饼图在iPhone中不显示内部滚动视图,iphone,xcode,Iphone,Xcode,我在Scrollview中创建饼图,它是主视图的子视图,然后我添加饼图作为scroll视图的子视图,但它不显示饼图 我有以下代码 -(void)loadNews{ NSArray *graphs = [[NSArray alloc] initWithObjects:@"1", nil]; NSInteger numberofPages=[graphs count]; for (int i = 0; i < [graphs count]; i++) { CGRect

我在Scrollview中创建饼图,它是主视图的子视图,然后我添加饼图作为scroll视图的子视图,但它不显示饼图

我有以下代码

   -(void)loadNews{

NSArray *graphs = [[NSArray alloc] initWithObjects:@"1", nil];

NSInteger numberofPages=[graphs count];


for (int i = 0; i < [graphs count]; i++) {

    CGRect frame;
    frame.origin.x = self.scrollView.frame.size.width * i;
    frame.origin.y = 0;
    frame.size = self.scrollView.frame.size;
    UIView*subView=[[UIView alloc ]initWithFrame:frame];
    [self.scrollView addSubview:subView];


    //PieClass *myPieClass=[[PieClass alloc]initWithFrame:CGRectMake(250,450,320,230)];
    PieClass *myPieClass=[[PieClass alloc]initWithFrame:CGRectMake(327,470,320,230)];

    //myPieClass.backgroundColor=[UIColor clearColor];
    myPieClass.backgroundColor=[UIColor blackColor];

    myPieClass.itemArray=[[NSArray alloc]initWithObjects:valueOne,valueTwo,valueThree,valueFour, nil];

    myPieClass.myColorArray=[[NSArray alloc]initWithObjects:[UIColor blueColor],[UIColor redColor],[UIColor greenColor],[UIColor brownColor], nil];

    myPieClass.radius=100;

    [subView addSubview:myPieClass];

}




self.scrollView.contentSize = CGSizeMake(self.scrollView.frame.size.width * graphs.count, self.scrollView.frame.size.height);
[pageControl setNumberOfPages:numberofPages];

[pageControl setActivePageColor:[UIColor colorWithRed:36/255.0 green:71/255.0 blue:113/255.0 alpha:1.0]];
[pageControl setInactivePageColor:[UIColor lightGrayColor]];

}
-(无效)加载新闻{
NSArray*图形=[[NSArray alloc]initWithObjects:@“1”,nil];
NSInteger numberofPages=[图形计数];
对于(int i=0;i<[图形计数];i++){
CGRect帧;
frame.origin.x=self.scrollView.frame.size.width*i;
frame.origin.y=0;
frame.size=self.scrollView.frame.size;
UIView*子视图=[[UIView alloc]initWithFrame:frame];
[self.scrollView addSubview:subView];
//PieClass*myPieClass=[[PieClass alloc]initWithFrame:CGRectMake(250450320230)];
PieClass*myPieClass=[[PieClass alloc]initWithFrame:CGRectMake(327470320230)];
//myPieClass.backgroundColor=[UIColor clearColor];
myPieClass.backgroundColor=[UIColor blackColor];
myPieClass.itemArray=[[NSArray alloc]initWithObjects:valueOne、valueTwo、valueThree、valueFour、nil];
myPieClass.MyColorary=[[NSArray alloc]initWithObjects:[UIColor blueColor]、[UIColor REDCLOR]、[UIColor GREENCLOR]、[UIColor BROWNCOCLOR]、nil];
myPieClass.半径=100;
[子视图添加子视图:myPieClass];
}
self.scrollView.contentSize=CGSizeMake(self.scrollView.frame.size.width*graphs.count,self.scrollView.frame.size.height);
[pageControl setNumberOfPages:numberofPages];
[pageControl-setActivePageColor:[UIColor-WithRed:36/255.0绿色:71/255.0蓝色:113/255.0 alpha:1.0];
[pageControl setInactivePageColor:[UIColor lightGrayColor]];
}
CGRectMake(327470320230)中的
您正在设置327470的原点


尝试类似CGRectMake(100100320230)的方法。

是的,它现在正在工作,但与我为其他图表所做的相同,它没有显示>>“但与我为其他图表所做的相同,它没有显示”意味着我有另一个具有相同坐标的历史图,我正在给出,但没有显示。我需要查看一些代码,以找出哪里出了问题。如果可以的话,你可以复制一些。