读书人

android 设立View

发布时间: 2012-09-05 15:19:35 作者: rapoo

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
这是两个不同的对象,有时间内容相同。 具体看代码。

读书人网 >Android

热点推荐