|
 |
10년 전 |
public class MyView extends View {
private PopupWindow mPopup;
// View(을)를 가진다PopupWindow(을)를 작성한다
public void makePopupWindow(View v) {
mPopup = new PopupWindow(context);
mPopup.setWindowLayoutMode(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
mPopup.setContentView(v);
}
// MyView(으)로부터의 상대 위치(x, y)에PopupWindow(을)를 표시한다
public void showPopupWindow(int x, int y) {
if (mPopup.isShowing()) {
View v = popup.getContentView()
int width = v.getMeasuredWidth();
int height = v.getMeasuredHeight();
mPopup.update(x, y, width, height);
} else {
mPopup.showAtLocation(this, Gravity.NO_GRAVITY, x, y);
}
}
}
|
|
추천 : 448 |
추천
목록
|
|