0
 - (void)viewDidLoad
    {
   [super viewDidLoad];

    [self.segmentedControl removeAllSegments];
    s = 0;
    for (NSDictionary *dictionary in self.top.segments) {
        [_segmentedControl insertSegmentWithTitle:dictionary [@"sTitle"] atIndex:s animated:NO];
        self.bioTextView.text = [NSString stringWithFormat:@"%@", dictionary [@"sData"]];
    }}

我的 segmentedControl 以相反的顺序开始。请哪位知道,告诉我如何解决这个问题?请看视频中的例子:http: //youtu.be/YSYFxvb7fpA

4

1 回答 1

1

您总是在索引 0 处添加新段,即在开头。

所以你变得像:

A

B>A

C>B>A

您需要在最后添加。

利用:

s = 0;
for (NSDictionary *dictionary in self.top.segments) {
    [_segmentedControl insertSegmentWithTitle:dictionary [@"sTitle"] atIndex:s animated:NO];
    self.bioTextView.text = [NSString stringWithFormat:@"%@", dictionary [@"sData"]];
    s++;
}
于 2013-05-31T09:07:23.900 回答