我正在膨胀 aView
并将其添加到 aListView
中,以将其用作ListView
. ListView
问题是除非我更改View
为例如,否则视图不会呈现,我不能在这里TextView
使用简单View
的吗?为什么?
这是添加垫的代码:
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view top_pad = inflater.inflate(R.layout.search_pad, null);
list.addHeaderView(top_pad);
pad XML 文件layout.search_pad
<?xml version="1.0" encoding="UTF-8"?>
<View
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="#333" />