本文主要是介绍PopupWindow封装-view上方显示和下方显示,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
开源地址:http://simple-quickactions.googlecode.com/svn/trunk
本地下载:http://download.csdn.net/detail/u011127787/5724159
package org.example.qberticus.quickactions;import android.content.Context;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.widget.PopupWindow;/*** This class does most of the work of wrapping the {@link PopupWindow} so it's simpler to use.* * @author qberticus* */
public class BetterPopupWindow {/**触发view**/protected final View anchor;private final PopupWindow window;/**PopupWindow的根view**/private View root;private Drawable background = null;private final WindowManager windowManager;/*** Create a BetterPopupWindow* * @param anchor* the view that the BetterPopupWindow will be displaying 'from'*/public BetterPopupWindow(View anchor) {this.anchor = anchor;t
这篇关于PopupWindow封装-view上方显示和下方显示的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!