Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
String 设置UIControl';s字体为大写_String_Cocoa_Cocoa Touch_Nsstring_Uppercase - Fatal编程技术网

String 设置UIControl';s字体为大写

String 设置UIControl';s字体为大写,string,cocoa,cocoa-touch,nsstring,uppercase,String,Cocoa,Cocoa Touch,Nsstring,Uppercase,如何将其设置为大写 - (void)drawSegmentedControl { HMSegmentedControl *segmentedControl = [[HMSegmentedControl alloc] initWithSectionTitles:@[@"First", @"Second", @"Third"]]; segmentedControl.font = [UIFont fontWithName:@"Helvetica Neue" size:16]; } 字

如何将其设置为大写

- (void)drawSegmentedControl
{
    HMSegmentedControl *segmentedControl = [[HMSegmentedControl alloc] initWithSectionTitles:@[@"First", @"Second", @"Third"]];
    segmentedControl.font = [UIFont fontWithName:@"Helvetica Neue" size:16];
}
字体将呈现您要求的字符;你必须使用大写字母,而不是小写字母(它们是不同的)

如果文本不是硬编码的,请在创建控件之前使用
[NSString uppercaseString]
对其进行转换

您对字体的选择将决定各个字形在屏幕上的呈现方式(它们是粗体、斜体、连环画或信使等)。但是您不能应用CSS样式将它们呈现为大写(就像您不能使用文字处理器的字体工具形成字体那样)


您只需将要传递的字符串大写。

HMSegmentedControl*segmentedControl=[[HMSegmentedControl alloc]initWithSectionTitles:@[@“FIRST”,“SECOND”,“THIRD”];
。这就是您想要的吗?我不太确定我是否理解您的问题。您可以用大写字母写标题或调用[@“FIRST”大写字符串];等其他标题。哦,有意义,谢谢!!!
HMSegmentedControl *segmentedControl = [[HMSegmentedControl alloc] initWithSectionTitles:@[@"FIRST", @"SECOND", @"THIRD"]];