का उपयोग कर मैं एक धराशायी बॉक्स आकर्षित करने के लिए, निम्नलिखित कोड का उपयोग कर पा रहा था लाइन धराशायी:ड्राइंग CALayer
CAShapeLayer *shapeLayer = [CAShapeLayer layer];
CGRect shapeRect = CGRectMake(0.0f, 0.0f, 200.0f, 100.0f);
[shapeLayer setBounds:shapeRect];
[shapeLayer setPosition:CGPointMake(self.coreImageView_.frameX, self.coreImageView_.frameBottom - self.coreImageView_.frameHeight/2)];
[shapeLayer setFillColor:[[UIColor clearColor] CGColor]];
[shapeLayer setStrokeColor:[[UIColor whiteColor] CGColor]];
[shapeLayer setLineWidth:2.0f];
[shapeLayer setLineJoin:kCALineJoinRound];
[shapeLayer setLineDashPattern:
[NSArray arrayWithObjects:[NSNumber numberWithInt:5],
[NSNumber numberWithInt:5],
nil]];
अब अगर मैं सिर्फ बी बिंदु से बिंदु एक्स से एक चित्तीदार लाइन आकर्षित करने के लिए चाहते हैं, मैं कैसे को संशोधित करना चाहिए यह कोड?
बिंदु एक्स और बिंदु बी द्वारा आपका क्या मतलब है? वे आपके आयत पर अंक हैं या वे स्क्रीन पर कहीं भी 2 अंक हैं? –
संभावित डुप्लिकेट [यहां] (http://stackoverflow.com/questions/12091916/uiview-with-a-dashed-line) –
http://stackoverflow.com/questions/12091916/uiview-with-a-dashed- लाइन/12092002 # 12092002 –