के साथ आवेदन नहीं कर रहा है मैं एक परत के भीतर एक पाठ के फ़ॉन्ट गुणों को संशोधित करने की कोशिश कर रहा हूं लेकिन ऐसा नहीं होता है। क्या कोई मदद कर सकता है? कृपया नीचे दिए गए कोड को खोजने:फ़ॉन्ट आकार और प्रकार CATextLayer
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
// All HypnosisViews start with a clear background color
[self setBackgroundColor:[UIColor clearColor]];
[self setCircleColor:[UIColor lightGrayColor]];
// Create the new layer object
boxLayer = [[CATextLayer alloc] init];
// Give it a size
[boxLayer setBounds:CGRectMake(0.0, 0.0, 300.0, 85.0)];
// Give it a location
[boxLayer setPosition:CGPointMake(160.0, 350.0)];
// Make half-transparent red the background color for the layer
UIColor *reddish = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.75];
// Get CGColor object with the same color values
CGColorRef cgReddish = [reddish CGColor];
[boxLayer setBackgroundColor:cgReddish];
// Make it a sublayer on the view's layer
[[self layer] addSublayer:boxLayer];
NSString *text2 = @"You are me.";
UIFont *font2 = [UIFont fontWithName:@"Times New Roman" size:10.0];
[text2 sizeWithFont:font2];
[boxLayer setString:text2];
}
return self;
}
यह शानदार है। धन्यवाद। इसने काम कर दिया। – Armand
परफेक्ट - यदि आप यही खोज रहे थे, तो कृपया इसे सही उत्तर के रूप में चिह्नित करें ताकि यह दूसरों के लिए दृश्यमान हो सके! –
निश्चित रूप से मैं करूँगा लेकिन यह कैसे करें? मैं इस साइट पर नया हूं। इसके बारे में CATextLayer: क्या परत परत कोने के लिए कोई रास्ता है? और परत के अंदर एक पाठ के लिए आप लाइनों को कैसे तोड़ेंगे? – Armand