Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在突出显示后自动获取文本。但我不想点击任何按钮或菜单......,只突出显示文本。我该怎么做?
以下代码将突出显示带有 bg 颜色的 textview
EditText edit = (EditText)findViewById(R.id.edit); BackgroundColorSpan span = new BackgroundColorSpan(0xFFAABBCC); edit.getText().setSpan(span, 0, edit.getText().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);