gpt4 book ai didi

objective-c - 以编程方式更改 UISegmentedControl 标题

转载 作者:行者123 更新时间:2023-12-02 07:06:57 24 4
gpt4 key购买 nike

如何以编程方式更改 UISegmentedControl 标题?你能帮帮我吗?

@synthesize filterControl; //UISegmentedControl

- (void)viewDidLoad
{
[super viewDidLoad];

filterControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"ALL",@"PROFIT",@"LOSS", nil]]; //not working

}

最佳答案

就用

-setTitle:(NSString*)title forSegmentAtIndex:(NSUInteger)index;

关于objective-c - 以编程方式更改 UISegmentedControl 标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10515614/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com