【发布时间】:2018-03-12 06:56:09
【问题描述】:
大家好,我一直在为我的项目构建自己的应用程序,因为我在其中一个片段中创建了片段,我需要通过单击整个线性布局来设置一个值。
但是当我这样做时,我在片段 java 代码findViewById 中遇到错误(无法解析方法findViewById(init))。
我被困在这个问题上,请帮帮我!
这是我在 OnCreateView 下的代码
View view = inflater.inflate(R.layout.notification, container, false);
LinearLayout set = (LinearLayout) findViewById(R.id.LinearLayout);
return view;
【问题讨论】:
-
使用
view.findViewById()