Android中国語API——PopupWindow


この文の上半分は私のためにAPIドキュメントを翻訳して、下半分はネットユーザーから資料を共有します.
APIドキュメント
継承ツリー:java.lang.Object ↳ android.widget.PopupWindow
  • 概要:popupWindowは、名前の通り、現在のActivityの前に任意のタイプのViewを表示するために使用できるインタフェースとして使用されます.
  • 共通のコンストラクタ:
  • PopupWindow() 
    PopupWindow(Context context) 
    PopupWindow(Context context, AttributeSet attrs) 
    PopupWindow(Context context, AttributeSet attrs, int defStyle) 
    PopupWindow(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) 
    //                、       、      0 popup window。
    //(    )
    PopupWindow(View contentView, int width, int height) 
    //          、  width、  height,   contentView popup window.
    PopupWindow(View contentView, int width, int height, boolean focusable) 
    //      ,                
    //( 2     )!!!!
  • 共通メソッド:
  • void  dismiss() 
    // popup window  
    
    int  getAnimationStyle() 
    //   popup window          ,      
    
    Drawable  getBackground() 
    //  popup window   ,    Drawable  
    
    void  setContentView(View contentView) 
    //   popup window     
    View  getContentView() 
    //  popup window     ,      View
    
    int  getHeight() 
    //   popup window    ,    int 
    
    void  setFocusable(boolean focusable) 
    //   popup window      
    
    void  setInputMethodMode(int mode) 
    /*        ,      :INPUT_METHOD_FROM_FOCUSABLE(            ), INPUT_METHOD_NEEDED(     ), or INPUT_METHOD_NOT_NEEDED(      )。  popup window   EditText         ,           popup window  ,         ,         。*/
    
    int  getInputMethodMode() 
    //    popup window         
    
    int  getMaxAvailableHeight(View anchor) 
    //      popup window         
    
    int  getMaxAvailableHeight(View anchor, int yOffset) 
    //  
    
    void  setSoftInputMode(int mode) 
    //          
    
    int  getSoftInputMode() 
    //          
    
    int  getWidth() 
    Return this popup's width MeasureSpec
    
    void  setHeight(int height) 
    Change the popup's height MeasureSpec
    
    boolean  isAboveAnchor() 
    //  popup window      View     
    
    boolean  isFocusable() 
    //    popup window      
    
    boolean  isOutsideTouchable() 
    //    pw          
    
    boolean  isShowing() 
    //    popup window        
    
    boolean  isSplitTouchEnabled() 
    //    pw        
    
    boolean  isTouchable() 
    //    pw        
    
    void  setAnimationStyle(int animationStyle) 
    //  popup window     ,      Animation
    
    void  setBackgroundDrawable(Drawable background)
    //  pw  
    
    void  setClippingEnabled(boolean enabled) 
    /*            。     ,         。   false   Windows    。    ,    Popupwindow                       ,       false */
    boolean  isClippingEnabled() 
    Indicates whether clipping of the popup window is enabled.
    void  setIgnoreCheekPress() 
    
    /*         ,    。       “    ”,   false,    。    “    ”? Events      , Events            CheekPress,                    */
    
    void  setOnDismissListener(PopupWindow.OnDismissListener onDismissListener) 
    //popup window        
    
    void  setOutsideTouchable(boolean touchable) 
    /*  popup window              ,   setTouchInterceptor    */
    
    void  setSplitTouchEnabled(boolean enabled) 
    //      、    ,     ,     
    
    void  setTouchInterceptor(View.OnTouchListener l) 
    /* popup window         */
    
    void  setTouchable(boolean touchable) 
    //  popup window     
    
    void  setWidth(int width) 
    /*  popup window   ,       popup window,         。          update()      */
    
    void  setWindowLayoutMode(int widthSpec, int heightSpec) 
    //  popup   window   
    
    void  showAsDropDown(View anchor) 
    /*(anchor,    : 。)        anchor   ,   anchor    ,   pop_view     view    ,      0,0*/
    
    void  showAsDropDown(View anchor, int xoff, int yoff)
    /*      ,   anchor        ,xoff    ,    . yoff,    ,    */ 
    
    void  showAsDropDown(View anchor, int xoff, int yoff, int gravity)
    /*      ,       */
    
    void  showAtLocation(View parent, int gravity, int x, int y) 
    /*          window        parent:    Layout id; gravity:Gravity.BOTTOM(         ),            x y 0,0        */
    
    void  update(View anchor, int width, int height)  
    void  update(int x, int y, int width, int height) 
    void  update(View anchor, int xoff, int yoff, int width, int height) 
    Updates the position and the dimension of the popup window.
    void  update() 
    void  update(int x, int y, int width, int height, boolean force) 
    void  update(int width, int height) 
    /*    popup window      ,             ,    setWidth         */
    

    Android PopupWindowの使用と分析