2010-04-02 28 views

回答

1

您可能正在尋找TTRoundedLeftArrowShapeTTRoundedRightArrowShape,它看起來像一個標準的Back iPhone按鈕。

1

我查看了源代碼,並填入了缺少的邏輯,爲語音氣泡的左側和右側繪製邊緣。

您可以找到代碼here

更改addRightEdge

if (_pointLocation > 135 && _pointLocation < 225) { 
    CGFloat pw = _pointAngle >= 90 && _pointAngle < 270 ? _pointSize.width : -_pointSize.width; 
    CGFloat pointY = ((_pointLocation-135)/90)*fh; 
    CGPathAddLineToPoint(path, nil, fw, pointY-floor(_pointSize.height/2)); 
    CGPathAddLineToPoint(path, nil, fw+pw, pointY); 
    CGPathAddLineToPoint(path, nil, fw, pointY+floor(_pointSize.height/2)); 
} 

更改addLeftEdge

if ((_pointLocation > 315 && _pointLocation <= 360) 
    || (_pointLocation >= 0 && _pointLocation < 45)) { 
    CGFloat pw = ((_pointAngle >= 270 && _pointAngle <= 360) 
       || (_pointAngle >= 0 && _pointAngle <= 90)) 
    ? _pointSize.width 
    : -_pointSize.width; 
    CGFloat pointY = (_pointLocation > 315 && _pointLocation <= 360) 
    ? fh-(((_pointLocation-315)/90)*fh) 
    : (fh/2)-((_pointLocation/90)*fh); 
    CGPathAddLineToPoint(path, nil, 0, pointY+floor(_pointSize.height/2)); 
    CGPathAddLineToPoint(path, nil, -pw, pointY); 
    CGPathAddLineToPoint(path, nil, 0, pointY-floor(_pointSize.height/2)); 
} 
+0

提問者應該紀念這個答案是正確的。美麗和簡單的投入。我使用Three20 1.0.5(迄今爲止最新),並且這個代碼是缺少的形式,雖然我希望你提交了一個拉請求。乾杯!並感謝修復! – Brett 2011-06-24 12:16:43