查看全文 [英] Viewing Complete Text
问题描述
大家好,
我正在寻找类似于Windows中的工具提示的解决方案(在Android中).其实是android的新手.
我有一个具有有限宽度的TextView ,并使用android的ellipsize属性将文本限制为可见(比TextView的宽度长).问题是发生 mouse_hover事件时,在TextView中将整个文本显示为工具提示.
请提出一些想法来实现这一目标.
谢谢
Yashwanth.
Hi all,
Am looking for a solution(in Android) similar to tooltip in windows. Actually am new to android.
Am having a TextView with a limited width and am limiting the text to be visible(which is longer than the TextView''s width) with android''s ellipsize property. And the problem is to show the entire text in the TextView as a tooltip when the mouse_hover event occurs.
Please suggest some ideas to achieve this.
Thank You
Yashwanth.
推荐答案
我不太确定,可以 ^ ]对您有帮助吗?
还是尝试这种类型的代码呢?
I am not so sure,can QuickAction[^] help you a bit?
Or what about trying this type of code?
View myView = (View)findViewById(R.id.my_view);
myView.setOnLongClickListener(new OnLongClickListener() {
@Override
public void onLongClick(View v) {
EditText et=(EditText)v;
Toast.makeText(this,et.getText().toString(), Toast.LENGTH_SHORT).show();
}
});
N.B. OnLongClickListener的目的是让用户在一段时间内点击文本框,然后吐司将显示其中的内容.
N.B.OnLongClickListener is for the purpose that user will tap over the textbox for sometime & then the toast will show what''s in it.
这篇关于查看全文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!