我有一個ListView
,其中行佈局有TextView
兩行限制:如何在用戶單擊時在ListView中顯示更多行?
android:lines="2"
所以,在默認情況下每個ListView的行顯示如下:
this is line 1 of the row 1
this is line 2 of the row 1
---------------------------
this is line 1 of the row 2
this is line 2 of the row 2
我想顯示/隱藏所有用戶單擊行時用於特定行的行。比方說,用戶點擊第1行,我想展示一些東西,如:
this is line 1 of the row 1
this is line 2 of the row 1
this is line 3 of the row 1
this is line 4 of the row 1
---------------------------
this is line 1 of the row 2
this is line 2 of the row 2
我在想ExpandableListView
使用,但是似乎它的目的是不同的。
我該如何實現我在找的東西?
它可能只是我,但您可能需要發佈更多關於這裏究竟發生了什麼的信息,我不太關注。 – gh123man
@ gh123man,我已經添加了示例 –
爲什麼你不能在項目點擊時調用'textView.setLines(4)'? – Desert