2016-11-11 49 views
-2

我在想如何在ios分段控件文本中做下劃線。帶有下劃線的IOS UI分段控件

感謝

+0

入住這一點 - https://github.com/ermalkaleci/CarbonKit – Rajat

+0

有它莢:https://github.com/kitasuke/PagingMenuController –

回答

1

這SO後可以幫助你How to create Segmented control with underline in iOS。 您可以通過使用屬性來完成。事情是這樣的:

NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init]; 
[attributedString appendAttributedString:[[NSAttributedString alloc] initWithString:@"yourtext" 
                     attributes:@{NSUnderlineStyleAttributeName: @(NSUnderlineStyleNone)}]]; 
[_segmentedControl setTitleTextAttributes:attributedString forState:UIControlStateNormal];