-1

これを私のレイアウトに追加すると、それを膨らませて別のビューに追加した後、空のレイアウトが返されます

  <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());

//編集ビューは表示されますが、コンテンツはありません

4

1 に答える 1

0

inflate(int resource, ViewGroup root, boolean attachToRoot)および attachToRoot = trueを使用してインフレートしながら、このビューを ViewGroup にアタッチします。ルートは、インフレートするコンポーネントです。

于 2011-06-22T00:46:14.577 に答える