将其添加到我的布局中会在我将其膨胀并添加到另一个视图后返回一个空布局
<View
android:layout_width="fill_parent"
android:layout_height="1px"
android:background="#e0e0e0"/>
这是我给充气的方法
LayoutInflater vi = (LayoutInflater)getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = vi.inflate(R.layout.stoplistitem, null);
if(dt != null && stop.getDescription() != null)
dt.setText(stop.getDescription());
if(st != null && stop.getStreet() != null)
st.setText(stop.getStreet());
if(mt != null && stop.getMunicipal() != null)
mt.setText(stop.getMunicipal());
if(idt != null && stop.getId() != null){
idt.setText(stop.getId().toString());
//编辑我可以看到视图,但没有内容
在使用inflate(int resource, ViewGroup root, boolean attachToRoot)
和attachToRoot=true进行膨胀时将此视图附加到ViewGroup,root是要在其上膨胀的组件