android學習---- WindowManager 介面 (

來源:互聯網
上載者:User

標籤:

The interface that apps use to talk to the window manager.

這個介面用於與 window manager (視窗管理器, 應用程式框架層) 進行互動。

Use Context.getSystemService(Context.WINDOW_SERVICE)to get one of these.

通過 Context.getSystemService(Context.WINDOW_SERVICE)可以擷取到WindowManager的執行個體.

 

繼承關係

public interface WindowManager implements ViewManager

 

所屬包

android.view.WindowManager

 

 

方法

  • abstract Display getDefaultDisplay()

擷取預設顯示的 Display 對象。

  • abstract void removeViewImmediate(View view)

是removeView(View) 的一個特殊擴充,在方法返回前能夠立即調用該視圖層次的View.onDetachedFromWindow() 方法。

* 不適用於一般的程式;如果您要正確無誤的使用它,那您就需要格外小心了。

 

 

嵌套類

 

  • class WindowManager.BadTokenException
    Exception that is thrown when trying to add view whose WindowManager.LayoutParams token is invalid.
  • class WindowManager.LayoutParams

LayoutParams 布局參數 詳見:http://blog.sina.com.cn/s/blog_4b3c1f950100qd9s.html

 

 

WindowManager介面 的意義

這個介面用於與 window manager (視窗管理器) 進行互動。這個介面可以添加 view 到螢幕,也可以從螢幕刪除 view 。它面向的對象一端是螢幕,另一端就是 view ,直接忽略我們以前的 Activity 或者 Dialog 之類的東東。

 

window manager (視窗管理器)

Window Manager是Android中一個重要的服務(Service )。

Window Manager Service 是全域的,是唯一的。

它將使用者的操作,翻譯成為指令,發送給呈現在介面上的各個Window。Activity會將頂級的控制項註冊到 Window Manager 中,當使用者真是觸碰螢幕或鍵盤的時候,Window Manager就會通知到,而當控制項有一些請求產生,也會經由ViewParent送回到Window Manager中。從而完成整個通訊流程。

android學習---- WindowManager 介面 (

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.