帮我看一下这段代码,为什么anchor.getTop的值是一直不变。public class QuickAction extends CustomPopupWindow {
private final View root;
private final ImageView mArrowUp;
private final ImageView mArrowDown;
private final Animation mTrackAnim;
private final LayoutInflater inflater;
private final Context context;

public static final int ANIM_GROW_FROM_LEFT = 1;
public static final int ANIM_GROW_FROM_RIGHT = 2;
public static final int ANIM_GROW_FROM_CENTER = 3;
public static final int ANIM_AUTO = 4;

private int animStyle;
private boolean animateTrack;
private ViewGroup mTrack;
private ArrayList<ActionItem> actionList;

/**
 * Constructor
 * 
 * @param anchor  {@link View} on where the popup should be displayed
 */
public QuickAction(View anchor) {
super(anchor);
System.out.println("anchor6=1======="+anchor);
actionList = new ArrayList<ActionItem>();
context = anchor.getContext();
System.out.println("anchor.getContext()64======="+anchor.getContext());
inflater  = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

root = (ViewGroup) inflater.inflate(R.layout.quickaction, null);
System.out.println("root 68===="+root);
mArrowDown  = (ImageView) root.findViewById(R.id.arrow_down);
mArrowUp  = (ImageView) root.findViewById(R.id.arrow_up);

setContentView(root);
System.out.println("root 73===="+root);
mTrackAnim  = AnimationUtils.loadAnimation(anchor.getContext(), R.anim.rail);

mTrackAnim.setInterpolator(new Interpolator() {
public float getInterpolation(float t) {
              // Pushes past the target area, then snaps back into place.
                // Equation for graphing: 1.2-((x*1.6)-1.1)^2
final float inner = (t * 1.55f) - 1.1f;

            return 1.2f - inner * inner;
        }
});
        
mTrack  = (ViewGroup) root.findViewById(R.id.tracks);
animStyle = ANIM_AUTO;
animateTrack = true;
} /**
 * Animate track
 * 
 * @param animateTrack flag to animate track
 */
public void animateTrack(boolean animateTrack) {
this.animateTrack = animateTrack;
}

/**
 * Set animation style
 * 
 * @param animStyle animation style, default is set to ANIM_AUTO
 */
public void setAnimStyle(int animStyle) {
this.animStyle = animStyle;
} /**
 * Add action item
 * 
 * @param action  {@link ActionItem}
 */
public void addActionItem(ActionItem action) {
actionList.add(action); 
}

/**
 * Show popup window
 */
public void show () {
preShow(); int[] location  = new int[2];

anchor.getLocationOnScreen(location); Rect anchorRect  = new Rect(location[0], location[1], location[0] + anchor.getWidth(), location[1] 
                 + anchor.getHeight());
         System.out.println("anchorRect=130======"+anchorRect);
         System.out.println("anchor.getWidth()======"+anchor.getWidth());
         System.out.println("anchor.getHeight()======"+anchor.getHeight());
root.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
root.measure(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

int rootWidth  = root.getMeasuredWidth();
int rootHeight  = root.getMeasuredHeight();
 System.out.println("rootWidth======"+rootWidth);
 System.out.println("rootHeight======"+rootHeight);
         
int screenWidth  = windowManager.getDefaultDisplay().getWidth();
//int screenHeight  = windowManager.getDefaultDisplay().getHeight(); int xPos  = (screenWidth - rootWidth) / 2;
int yPos   = anchorRect.top - rootHeight; boolean onTop = true;
System.out.println("ontop====="+onTop);
// display on bottom
if (rootHeight > anchor.getTop()) {
yPos  = anchorRect.bottom;
onTop = false;
}
System.out.println("ontop====="+onTop);
        System.out.println("anchor.getTop------------"+anchor.getTop());
showArrow(((onTop) ? R.id.arrow_down : R.id.arrow_up), anchorRect.centerX());

setAnimationStyle(screenWidth, anchorRect.centerX(), onTop);

createActionList();

window.showAtLocation(this.anchor, Gravity.NO_GRAVITY, xPos, yPos);

if (animateTrack) mTrack.startAnimation(mTrackAnim);
}