2

I want to make curved text Of UILabel . How to do implement this ?

enter image description here

My label code till now is :

UILabel *loveLabel = [[UILabel alloc]init];
loveLabel.frame = CGRectMake(20, 50, 50, 50);
loveLabel.text = @"Flowers";
loveLabel.textAlignment = NSTextAlignmentCenter;
loveLabel.layer.cornerRadius = 25;
loveLabel.layer.masksToBounds = YES;
[self.view addSubview:loveLabel];
Leo
  • 24,596
  • 11
  • 71
  • 92
ios
  • 955
  • 1
  • 12
  • 35
  • Somebody already asked similar question I hope it will help you: http://stackoverflow.com/questions/3841642/curve-text-on-existing-circle – Bart Oct 26 '15 at 09:01

1 Answers1

1
You can download a sample project that use CoreTextArcView:    

github

import "CoreTextArcView.h" & add code in viewdidload

CGRect rect1 = CGRectMake(0, 120, 320, 120);
UIFont * font1 = [UIFont fontWithName:@"Helvetica" size:26.0f];
UIColor * color1 = [UIColor whiteColor];
CoreTextArcView * cityLabel = [[[CoreTextArcView alloc] initWithFrame:rect1
                                                                font:font1
                                                                text:@"New York City"
                                                              radius:85
                                                             arcSize:110
                                                               color:color1] autorelease];
cityLabel.backgroundColor = [UIColor clearColor];


CGRect rect2 = CGRectMake(0, 235, 320, 200);
CoreTextArcView * cityLabel2 = [[[CoreTextArcView alloc] initWithFrame:rect2
                                                                 font:font1
                                                                 text:@"Google"
                                                               radius:-80
                                                              arcSize:-80
                                                                color:color1] autorelease];

[cityLabel2 showsLineMetrics];
cityLabel2.backgroundColor = [UIColor clearColor];

[self.view addSubview:cityLabel];
[self.view addSubview:cityLabel2];
Maulik shah
  • 1,664
  • 1
  • 19
  • 45