去掉ExpandableListView的系統自帶的箭頭圖標

一個屬性就可以把它解決,<span style="color: rgb(51, 51, 51); font-family: Arial; line-height: 26px; "> settingLists.setGroupIndicator(null); </span>

如果你想更改它的形狀,但是位置是更改不了的,要注意了呀,更改形狀代碼如下:一個選擇的xml文件

<?xml version="1.0" encoding="utf-8"?>   

<selector xmlns:android="http://schemas.android.com/apk/res/android">   

    <item android:state_expanded="true" android:drawable="@drawable/expandablelistviewindicatordown" />   

    <item android:drawable="@drawable/expandablelistviewindicator" />   

</selector>  

再在源代碼中加一句:

settingLists.setGroupIndicator(this.getResources().getDrawable(R.layout.expandablelistviewselector)); 

大功告成
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章