の左側にあります。
あなたが本当にテキストで重力を持つようにしたい場合は、あなたのためのオプションをhere're:
1:
PopupWindow popupWindow = new PopupWindow(MainActivity.this);
popupWindow.setContentView(yourCustomView); // customview with list of textviews (with gravity inside)
popupWindow.showAsDropDown(anchorView); // display below the anchorview
2:PopupWindow
を使用してListPopupWindow
を使用して:
String[] products = {"Camera", "Laptop", "Watch", "Smartphone",
"Television", "Car", "Motor", "Shoes", "Clothes"};
ListPopupWindow listPopupWindow = new ListPopupWindow(MainActivity.this);
listPopupWindow.setAnchorView(view);
listPopupWindow.setDropDownGravity(Gravity.RIGHT);
listPopupWindow.setHeight(ListPopupWindow.WRAP_CONTENT);
listPopupWindow.setWidth(300);
listPopupWindow.setAdapter(new ArrayAdapter(MainActivity.this,
R.layout.list_item, products)); // list_item is your textView with gravity.
listPopupWindow.show();
がありますこれを見てくださいhttps://stackoverflow.com/questions/4303525/change-gravity-of-popupwindow –