我正在尝试获取我创建的 LinearLayout 中的片段:
编辑:这是在扩展的类中ArrayAdapter<G>
LinearLayout newView = new LinearLayout(getContext());
String inflater = Context.LAYOUT_INFLATER_SERVICE;
LayoutInflater li;
li = (LayoutInflater) getContext().getSystemService(inflater);
li.inflate(resource, newView, true);
在布局中有一个名为 TableRowView 的片段:
编辑:我更正了 XML 语法
<fragment android:name ="mypackage.TableRowView"
android:id="@+id/row"
android:layout_width="match_parent"
android:layout_height="match_parent" />
如何获取newView
's 片段?
在此先感谢,--大卫