开发者

Tooltip creation in android

开发者 https://www.devze.com 2023-04-10 00:05 出处:网络
I am using ListView in my application. For each listitem I have to keep four images to its right side. When I click on each image it has to move to that par开发者_高级运维ticular page. Though the imag

I am using ListView in my application. For each listitem I have to keep four images to its right side. When I click on each image it has to move to that par开发者_高级运维ticular page. Though the image specifies what it is meant for to know clearly I want to put a tooltip for each image. How can I create tooltip in android? Any help will be thankful to you.

Thank you


Normally tool tips are used when you hover over something using mouse..Tooltips are not a normal practice in touch screen devices..

If you want to do it, you can use a longClickListener and show a toast message with your tip string in it..

Toast viewToast = Toast.makeText(this, "Your tool tip", Toast.LENGTH_SHORT);
yourView.setOnLongClickListener(new OnLongClickListener() {
    @Override
    public void onLongClick(View v) {
        viewToast.show();
    }
});

well this is one way to do..Hope it helps..

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号