在做了一些阅读之后,我发现你可以在UISwitch控件上自定义文本和颜色.我很好奇这些方法是否会导致我的应用程序被批准并包含在App Store中时出现问题.
从iPhone Developer's Cookbook示例代码中获取的示例代码:
// Custom font, color
switchView = [[UICustomSwitch alloc] initWithFrame:CGRectZero];
[switchView setCenter:CGPointMake(160.0f,260.0f)];
[switchView setLeftLabelText: @"Foo"];
[switchView setRightLabelText: @"Bar"];
[[switchView rightLabel] setFont:[UIFont fontWithName:@"Georgia" size:16.0f]];
[[switchView leftLabel] setFont:[UIFont fontWithName:@"Georgia" size:16.0f]];
[[switchView leftLabel] setTextColor:[UIColor yellowColor]];
Run Code Online (Sandbox Code Playgroud)