PopWindows 下拉列表框 spinner 锚点

     @Override
     public void onClick(View v) {
          LayoutInflater from = LayoutInflater.from(getActivity());
          LinearLayout contentView = (LinearLayout) from.inflate(R.layout.activity_calendar_month_list , null);
           final PopupWindow pop = new PopupWindow(contentView, 250, 400, true );
           for( int i=0; i<5; i++){
              TextView text = (TextView) from.inflate(R.layout.activity_calendar_month_list_item , null);
              text.setText( "2012-12-12");
              contentView.addView(text);
              text.setOnClickListener( new OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        pop.dismiss();
                   }
              });
          }
          pop.setOutsideTouchable( false);
          pop.setFocusable( true);
          pop.setBackgroundDrawable( new BitmapDrawable());
          pop.showAsDropDown(v);
     }

你可能感兴趣的:(Android,android,spinner)