首页 > 其他 > 详细

xml中不能直接添加ViewGroup

时间:2017-01-10 08:25:57      阅读:165      评论:0      收藏:0      [点我收藏+]

我知道可以直接添加一个<View />的,今天想添加个容器类,然后后台动态添加SurfaceView到ViewGroup容器里,不过提示inflate报错了。难道ViewGroup不能直接这么添加吗?

<LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        >   
         <ViewGroup
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             />                
    </LinearLayout>

  不能, ViewGroup 是一个抽象类,无法直接实例化

xml中不能直接添加ViewGroup

原文:http://www.cnblogs.com/Im-Victor/p/6266893.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!