简体   繁体   English

Android:带有标注的弹出窗口

[英]Android: PopUp window with callout

I am trying to display a callout. 我正在尝试显示标注。 I have a button in my main layout. 我的主布局中有一个按钮。 Onclick of this Button I need to show a window popup with an arrow poiting to the button clicked. 这个Button onclick我需要显示一个弹出窗口,其中带有指向该按钮的箭头。 I tried using PopupWindow , but this shows a normal popup, I need to show it like a callout, coming out from the button. 我尝试使用PopupWindow ,但这显示了正常的弹出窗口,我需要像从按钮中弹出的标注一样显示它。 Any suggestions? 有什么建议么?

This is my coe so far 到目前为止,这是我的想法

            LayoutInflater inflater = getLayoutInflater();
            View mView= inflater.inflate(R.layout.lt_popupwindow,(ViewGroup)findViewById(R.id.ltPopUpParent));              
            View mView2= inflater.inflate(R.layout.main,(ViewGroup)findViewById(R.id.ltMainParent));
            PopupWindow mPopupWindow = new PopupWindow(mView,LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT,false);
            mPopupWindow.setAnimationStyle(android.R.style.Animation_Dialog);
            mPopupWindow.showAtLocation(mView2, Gravity.NO_GRAVITY, 0, 0);

Have a look here If you have not before , This might help you. 在这里看看如果您以前没有来过,这可能会对您有所帮助。

Android Quick Actions UI Pattern Android Quick Actions UI模式

Here is a PopupWindow-style liked widget might help you. 这是一个喜欢PopupWindow风格的小部件,可能会帮助您。

PointerPopupWindow PointerPopupWindow

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

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