我有一個使用自定義適配器來顯示我的自定義內容的列表視圖。它的佈局如下。將動畫添加到ListView以展開/摺疊內容
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<ImageView
android:id="@+id/itemimage"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="5"
android:scaleType="fitCenter"/>
<TextView
android:id="@+id/itemdescription"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:textSize="16sp"
android:layout_weight="1"/>
</LinearLayout>
<TextView
android:id="@+id/itemtext"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="TEXT CONTENT"
android:layout_weight="1"/>
</LinearLayout>
我想列表視圖只顯示了視圖與ids itemimage和項目描述,保持itemtext隱藏。 這個想法是在列表中的每個項目上都有一個onclicklistener,以便展開該項目以顯示itemtext內容。我知道我應該使用補間動畫來展開/摺疊每個項目,但我無法弄清楚如何做到這一點。
任何人都可以幫助我嗎?如果您需要更多代碼片段,請隨時詢問。
在此先感謝。
嗨,你終於明白了嗎?我會對解決方案感興趣。 – dragoon 2013-06-27 22:34:36