如何在单击的视图附近显示自定义视图帮助框。
How to show a custom view help box near the clicked view.
如何在 android 中实现。https://www.google.com/design/spec/motion/choreography.html#choreography-creation 此菜单从触摸点出现,将元素绑定到触摸点。
Error message in edittext comes in the bottom of the view
您可以使用 PopupWindow,然后使用 popupWindow.showAsDropDown(theView)。
编辑:
这是我的代码中的一个示例:
LayoutInflater inflater = (LayoutInflater) TimeCheckActivity.this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.timecheck_popup,
(ViewGroup) findViewById(R.id.popup_element));
popupWindow = new PopupWindow(layout, 320, 160, true);
popupWindow.setBackgroundDrawable(new BitmapDrawable());
popupWindow.setOutsideTouchable(true);
radioButton[1].setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if(times.size()>1) {
popupText.setText(times.get(1).toString());
popupWindow.showAsDropDown((View) radioButton[1]);
}
return true;
}
});
我还有 xml 布局,其中包含 Textview ("popupText")。
如何在 android 中实现。https://www.google.com/design/spec/motion/choreography.html#choreography-creation 此菜单从触摸点出现,将元素绑定到触摸点。
Error message in edittext comes in the bottom of the view
您可以使用 PopupWindow,然后使用 popupWindow.showAsDropDown(theView)。
编辑: 这是我的代码中的一个示例:
LayoutInflater inflater = (LayoutInflater) TimeCheckActivity.this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.timecheck_popup,
(ViewGroup) findViewById(R.id.popup_element));
popupWindow = new PopupWindow(layout, 320, 160, true);
popupWindow.setBackgroundDrawable(new BitmapDrawable());
popupWindow.setOutsideTouchable(true);
radioButton[1].setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if(times.size()>1) {
popupText.setText(times.get(1).toString());
popupWindow.showAsDropDown((View) radioButton[1]);
}
return true;
}
});
我还有 xml 布局,其中包含 Textview ("popupText")。