首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android 设立View

2012-09-05 
android 设置View回去window属性WindowManager.LayoutParams l r.window.getAttributes()Decor 为Phone

android 设置View
回去window属性
WindowManager.LayoutParams l = r.window.getAttributes();

Decor 为PhoneWindow.DecorView  这个View其实是一个Activity 的最底层View
wm.addView(decor, l);


调用PhoneWindow的LocalWindowManager 中的addView


调用 WindowManagerImpl 的addView
进一步调用如下方法:
final WindowManager.LayoutParams wparams                = (WindowManager.LayoutParams)params;root.setView(view, wparams, panelParentView);



ViewRoot里面也有一个Window  Attribute变量mWindowAttributes  ---Window
attrs 为Window的Attribute  mWindowAttributes.copyFrom(attrs);--ViewRoot
这是两个不同的对象,有时间内容相同。 具体看代码。

热点排行