【问题标题】:How can I sort a ListView alphabeticly BUT with special characters at the bottom?如何按字母顺序对 ListView 进行排序,但底部有特殊字符?
【发布时间】:2012-09-26 09:07:39
【问题描述】:

我想要一个按字母顺序排列的 Listview,但特殊字符位于列表底部。

所以它看起来像这样:

  1. 列表项
  2. 啊啊
  3. Bbb
  4. 抄送
  5. ddd
  6. 等等
  7. '''''
  8. ((((
  9. $$$$

【问题讨论】:

    标签: android listview sorting character


    【解决方案1】:

    您可以调用适配器的sort 方法以您想要的方式执行排序。例如:

    adapter.sort(new Comparator<String>() {
        public int compare(String arg0, String arg1) { //modify it to suit your needs
            return arg0.compareTo(arg1);
        }
    });
    

    【讨论】:

      【解决方案2】:

      尝试使用 Collat​​or(见 here

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-10-28
        • 2013-11-09
        • 1970-01-01
        • 2012-02-06
        • 2012-09-14
        • 1970-01-01
        相关资源
        最近更新 更多