내 질문의 제목은 내가 묻고 싶은 것을 요약합니다. 설명에서 내 질문을 자세히 설명합니다.Android에서 ExpandableListView의 배경색을 변경하는 방법은 무엇입니까?
그래서 나는 ExpandableListView를 가지고 있으며 내부에 흰색 텍스트가있는 검정색으로 화면에 인쇄됩니다. 목록을 누르면 해당 항목이 소비되고 세부 정보를 선택할 수 있습니다. 그것은 다음과 같은 :
|--------------------------|
|black color |
| Title text(in white) |
| |
|__________________________|
| Item 1 (black text with white background)
| Item 2 |
| Item N... |
그래서 제 질문은 "텍스트 제목"내부의 배경색을 변경하고 제목에 표시되는 문자의 수에 대한 제한을 넣어하는 방법은?
<ScrollView
android:layout_width="fill_parent"
android:layout_height="228dp" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#f4f4f4"
android:orientation="vertical" >
<ExpandableListView
android:id="@+id/lvExp"
android:layout_width="match_parent"
android:layout_height="485dp" >
</ExpandableListView>
</LinearLayout>
</ScrollView>
항목 : 여기
내 XML 파일입니다. XML :<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="55dip"
android:orientation="vertical" >
<TextView
android:id="@+id/lblListItem"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="17dip"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="?android:attr/expandableListPreferredChildPaddingLeft" />
</LinearLayout>
Group.XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp"
android:background="#000000">
<TextView
android:id="@+id/lblListHeader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
android:textSize="17dp"
android:textColor="#f4f4f4"
android:background="#323232"/>//this only changes some part of the background just around the text ONLY
</LinearLayout>
당신이 무엇을 의미합니까 "을 제목에 표시되는 문자의 수에 대한 제한을 넣어"? – Shahzeb
예를 들어 제목이 "고기 먹기를 좋아합니다"라는 메시지가 나타나면 "나는 먹기를 좋아합니다 ..." – user3182266
android : singleLine = "true"속성의 텍스트 뷰 – Shahzeb