0
如何在android中實現這一點。 https://www.google.com/design/spec/motion/choreography.html#choreography-creation此菜單從觸摸點出現,將元素綁定到觸摸點。如何在點擊的視圖附近顯示自定義視圖幫助框。
Error message in edittext comes in the bottom of the 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;
}
});
我也有具有的TextView( 「popupText」)的XML佈局。
不能正常工作。可以分享一些鏈接或代碼。 –
@SagarGawawane我編輯了我的答案。覈實。 –
感謝它的工作。 –