Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.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
Iphone 压缩索引节IndexTitlesFortableView_Iphone_Uitableview_Ios7 - Fatal编程技术网

Iphone 压缩索引节IndexTitlesFortableView

Iphone 压缩索引节IndexTitlesFortableView,iphone,uitableview,ios7,Iphone,Uitableview,Ios7,在iOS7 SDK中加载我的应用程序。我的tableview索引列表现在已压缩: 我似乎找不到可能发生的事情。我没有在任何地方设定尺寸或长度。下面是我分配标题的代码,但我猜问题一定在其他地方 - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView { NSMutableArray *titleArray = [[NSMutableArray alloc] init]; if (BookHasSe

在iOS7 SDK中加载我的应用程序。我的tableview索引列表现在已压缩:

我似乎找不到可能发生的事情。我没有在任何地方设定尺寸或长度。下面是我分配标题的代码,但我猜问题一定在其他地方

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
    NSMutableArray *titleArray = [[NSMutableArray alloc] init];

    if (BookHasSections())
    {
        NSInteger sections = tableView.numberOfSections;

        for (int section = 0; section < sections; section++)
        {
            switch (section)
            {
                case 0:
                    [titleArray addObject:@"1"];
                    break;
                default:
                    [titleArray addObject:[NSString stringWithFormat:@"%d0",section]];
                    break;
            }
        }
    }

    return titleArray;
}
-(NSArray*)sectionIndexTitlesForTableView:(UITableView*)表视图
{
NSMutableArray*titleArray=[[NSMutableArray alloc]init];
如果(BookHasSections())
{
NSInteger sections=tableView.numberOfSections;
对于(int section=0;section
我认为这正是iOS 7现在默认显示部分索引标题的方式。我同意这并不是最好的解决方案。是的,我已经在其他应用程序中观察到了这种现象。我不明白一些UI设计师是如何坐在椅子上思考的,“你知道,如果索引更短,它看起来会更好。”这有解决方案吗?联系人应用程序没有这个问题…据我所知不是。我仍然不确定它是否真的是一个bug。根据@MarkoNikolovski的说法,这是iOS7的一项功能。不过,你确实在联系人应用程序中提出了一个很好的观点。尽管我会说,我注意到联系人项目在每个字母之间都有“点”字符。音乐应用程序也是这样。不确定是否有任何苹果应用程序可能使用编号列表而不是字母表?想不到有;不确定它是否重要-当没有足够的空间来显示整个列表时(有点像……在文本中)使用点。我的应用程序在索引中有大约200个条目,所以我得到了这些点——但它只占用了与图中相同的空间