ios - 如何制作UILabel Objective c的弯曲文本
<p><p>我想制作 <code>UILabel</code> 的弯曲文本。如何实现这个?</p>
<p> <a href="/image/mSu7M.png" rel="noreferrer noopener nofollow"><img src="/image/mSu7M.png" alt="enter image description here"/></a> </p>
<p>到目前为止,我的标签代码是:</p>
<pre><code>UILabel *loveLabel = [init];
loveLabel.frame = CGRectMake(20, 50, 50, 50);
loveLabel.text = @"Flowers";
loveLabel.textAlignment = NSTextAlignmentCenter;
loveLabel.layer.cornerRadius = 25;
loveLabel.layer.masksToBounds = YES;
;
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><pre><code>You can download a sample project that use CoreTextArcView:
</code></pre>
<p> <a href="https://github.com/javenisme/CurvaView" rel="noreferrer noopener nofollow">github</a> </p>
<p>导入“CoreTextArcView.h”并在viewdidload中添加代码</p>
<pre><code>CGRect rect1 = CGRectMake(0, 120, 320, 120);
UIFont * font1 = ;
UIColor * color1 = ;
CoreTextArcView * cityLabel = [[ initWithFrame:rect1
font:font1
text:@"New York City"
radius:85
arcSize:110
color:color1] autorelease];
cityLabel.backgroundColor = ;
CGRect rect2 = CGRectMake(0, 235, 320, 200);
CoreTextArcView * cityLabel2 = [[ initWithFrame:rect2
font:font1
text:@"Google"
radius:-80
arcSize:-80
color:color1] autorelease];
;
cityLabel2.backgroundColor = ;
;
;
</code></pre></p>
<p style="font-size: 20px;">关于ios - 如何制作UILabel Objective c的弯曲文本,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/33341405/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/33341405/
</a>
</p>
页:
[1]