现在的位置: 首页 > 综合 > 正文

ViewManager

2014年02月03日 ⁄ 综合 ⁄ 共 643字 ⁄ 字号 评论关闭

/** Interface to let you add and remove child views to an Activity. To get an instance
  * of this class, call {@link android.content.Context#getSystemService(java.lang.String) Context.getSystemService()}.
  */
public interface ViewManager
{
    public void addView(View view, ViewGroup.LayoutParams params);
    public void updateViewLayout(View view, ViewGroup.LayoutParams params);
    public void removeView(View view);
}

 

ViewManager里面的内容比较少,我就全部拷贝过来了。如上所示:ViewManager是一个接口,里面有3个方法,此接口使你可以向一个Activity中添加和移除子视图。调用Context.getSystemService(),你可以得到该类的一个实例。(ViewManager是个接口,没有任何实现,抽象类ViewGroup对该接口的三个方法进行了具体实现。)

 

网上还看到一个ViewManager的使用DEMO,如下:

http://blog.csdn.net/cocohufei/article/details/6080509

抱歉!评论已关闭.