Layout params of loaded view are ignored

后端 未结 3 2010
滥情空心
滥情空心 2020-12-08 09:44

I\'m trying to write my own custom View and I have problem with LayoutParams.

The idea is to extend ViewGroup (LinearLa

3条回答
  •  一向
    一向 (楼主)
    2020-12-08 10:12

    Use following statement to inflate:

    View view = inflater.inflate( R.layout.item /* resource id */,
                                             MyView.this /* parent */,
                                             false /*attachToRoot*/);
    

提交回复
热议问题