在ListView的右边添加字母列表,点击某个字母时,列表就滚动到预期位置。

<!-- 数字和字母栏在标题栏下边并且停靠在右边 -->
<com.txrj.sms.component.QuickAlphaBar
    android:));
                mPaint.setFakeBoldText(true);
            }
            float x = getWidth() / 2 - mPaint.measureText(letters[i]) / 2;
            float y = singleHeight * (i + 1);
            canvas.drawText(letters[i], x, y, mPaint);
            mPaint.reset();
        }
    }
   
    public void setListView(ListView listView) {
        mListView = listView;
    }
   
    public void setAlphaIndexer(HashMap<String, Integer> alphaIndexer) {
        this.alphaIndexer = alphaIndexer;
    }
   
    public void setTextView(TextView textView) {
        this.mAlphsTextView = textView;
    }
}

相关文章:

  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
猜你喜欢
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2021-09-21
  • 2022-12-23
相关资源
相似解决方案