我们怎么能够具体说明Indexes公司展示的宽度。 我的图像显示如下,将解释我的状况。
I want to wrap the words within the sectionIndex and it is possible when SectionIndex frame size is fixed so I want to set the width of the SectionIndex Frame as displayed on the right side.SectionIndex frame automatically resizes according to the word length within it.
我写了该守则,以便把IndexTitle编成如下文:
NSMutableArray *array = [[NSMutableArray alloc] init];
for (int i = 0; i <[keys count]; i++) {
NSString *str = [self.keys objectAtIndex:i];
int length = [str length];
if (length > 9) {
str = [NSString stringWithFormat:@"%@..",[str substringToIndex:8]];
}
[array addObject:str];
}
NSArray *a =[NSArray arrayWithArray:array];
[array release];
return a;
请就此帮助我!