2010-11-01 77 views
0

我想用下面的代碼畫一個圓圈。問題與繪圖圈

-(void)drawRect 
{ 
    CGContextRef contextRef = UIGraphicsGetCurrentContext(); 
    CGContextSetRGBFillColor(contextRef,1,0,0,1); 
    CGContextFillEllipseInRect(contextRef, self.frame); 

} 

我得到我的圈子不如預期,但在圓截的邊緣/ interrupted.Can你們,請幫助該如何解決這個問題呢?

由於提前, S.

回答

0

嘗試使用self.bounds代替self.frame。你從屬於哪一類? 也許你必須使用self.view.bounds或self.view.frame?

+0

UIView是sublcass – sekhar 2010-11-01 18:16:00

+0

我使用self.frame作爲參數 – sekhar 2010-11-01 18:22:13

+0

你嘗試過使用self.bounds嗎? – oddi 2010-11-01 18:24:19