这是屏幕截图,在最后一个下拉菜单中,我点击了它,它显示了一些菜单
但不是这样,我想在这里添加排序菜单,如
1. sort by date
2. sort by name
3. sort by ...etc
答案 0 :(得分:1)
我使用DropDown作为我的项目,我们可以轻松自定义这些DropDownCell(customCell)&外表也是。
您可以通过PODS
与项目集成pod' DropDown'
答案 1 :(得分:0)
对于按键的短数组..类似名称....放置要在其上缩短数组的键
这将使你的数组升序
NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"Your Key" ascending:YES selector:@selector(localizedStandardCompare:)];
NSArray *shortedArray=[Your array sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor,nil]];
这将使您的阵列缩短
NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"Your Key" ascending:NO selector:@selector(localizedStandardCompare:)];
NSArray *shortedArray=[Your array sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor,nil]];