简体   繁体   English

如何在EditText中选择文本并为Android中的RTF编辑提供工具提示

[英]How to select the text in EditText and provide tooltip for the Rich Text Editing in Android

How can we select a part of the text in EditText. 我们如何在EditText中选择文本的一部分。 And after selecting that part of the text, how can we provide a tooltip to make that text rich, ie providing different toggle button kind of things in the tooltip to change the fontstyle, color, bold, italics etc. 在选择了文本的那一部分之后,我们如何提供工具提示以使该文本变得丰富,即在工具提示中提供不同的切换按钮类功能,以更改字体,颜色,粗体,斜体等。

private class CustomTextWatcher implements TextWatcher 
{
    private EditText myEditText;

    public CustomTextWatcher(EditText e) 
    {
        myEditText = e;
    }

    public void beforeTextChanged(CharSequence s, int start, int count,int after) 
    {

    }

    public void onTextChanged(CharSequence s, int start, int before,
            int count) {
        //do the stuff you want to do here.
    }

    @Override
    public void afterTextChanged(Editable arg0) {

    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM