0
我添加到myListView標題TextView
和onItemClickListener
位置向上移動,並且標題變爲可點擊(他的位置現在爲一),列表項目位置+1爲什麼?ListView.addHeaderView有bug?
Code.java
View header = getLayoutInflater().inflate(R.layout.header_text, null);
mMoviesList.addHeaderView(header);
header_text.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/_main_shadow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/after_top_bar_margin_left"
android:layout_marginTop="@dimen/after_top_bar_margin_top"
android:paddingBottom="5px"
android:text="Показывают в кино"
android:textColor="#898989"
android:textSize="12sp" />
如何解決這一問題?
這對我很有幫助。並在onItemClickListener我添加位置1 –
謝謝Dheeraj和Ozik你們都很棒 – ismail