【发布时间】:2011-06-22 00:21:58
【问题描述】:
将它添加到我的布局后,我将它膨胀并添加到另一个视图后会返回一个空布局
<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());
//edit 可以看到视图,但是没有内容
【问题讨论】:
-
您发布的代码仍然不足以理解您如何将行视频添加到主布局。
-
它只是在根 LinearLayout 后跟 4 个 EditTexts
标签: android layout view border rulers