Я не знаю, как мы можем добавить значок в ExpandableListView
. Я искал несколько ключевых слов, но не сказал об этом. Итак, я размещаю фотографию и хочу знать, что это может произойти? Спасибо за поддержку.android Добавить знак на Expandablelistview
0
A
ответ
0
Создать два файла макета XML для группы и дочерние представления соответственно - Например, group_layout.xml и child_layout.xml Эти макеты завышены и используются в пользовательском ExpandableListAdapter, как показано ниже.
Для информации, пожалуйста, проверьте url
0
Вот мой solotion для этого примера:
bg_badge.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<corners android:radius="20dp" />
<solid android:color="#ff2233" />
</shape>
tab_indicator.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dip"
android:layout_height="60dip"
android:layout_weight="1"
android:background="@drawable/tab_indicator"
android:orientation="vertical"
android:padding="5dp">
<TextView
android:id="@+id/lblNumberBadge"
android:layout_width="wrap_content"
android:layout_height="22dp"
android:textStyle="bold"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/bg_badge"
android:gravity="center_vertical|center_horizontal"
android:paddingBottom="5dp"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:layout_gravity="top|right"
android:textColor="@color/white"
android:visibility="gone" />
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/tab_ask" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:textColor="@drawable/tab_color"
android:textSize="13sp"
android:textStyle="bold" />
</RelativeLayout>
row_child.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layoutmain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:padding="5dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/tv_badge_text"
android:orientation="vertical" >
<TextView
android:id="@+id/txtTitleSearch1"
style="@style/TextSizeNormalFont"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text="@string/app_name"
android:textColor="@android:color/black"
android:textStyle="bold" />
<TextView
android:id="@+id/txtTitleSearch2"
style="@style/TextSizeNormalFont"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:layout_marginLeft="20dp" />
<TextView
android:id="@+id/txtTitleSearch3"
style="@style/TextSizeNormalFont"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:layout_marginLeft="20dp" />
</LinearLayout>
<TextView
android:id="@+id/tv_badge_text"
style="@style/TextBadgeNumber"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:paddingTop="2dp"
android:text="@string/newtext"
android:visibility="visible" />
</RelativeLayout>
row_group.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/row_name"
style="@style/TextSizeNormalFont"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:paddingLeft="40dp"
android:paddingTop="10dp"
android:text="@string/app_name"
android:textColor="@android:color/black"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_badge_number"
style="@style/TextBadgeNumber"
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:paddingTop="3dp"
android:text="@string/badge_number"
android:visibility="visible" />
</RelativeLayout>
Надежда помочь кому-то.
Скриншот: http://i905.photobucket.com/albums/ac258/phamthangnd/Untitled_zps18aa246f.png
Смежные вопросы
- 1. Аккордеон/ExpandableListView на Android
- 2. Добавить анимацию в ExpandableListView
- 3. ExpandableListView внутри ExpandableListView в android
- 4. Android ExpandableListView
- 5. Добавить динамические дочерние представления в expandableListView android
- 6. Добавить заголовок в ChildView из ExpandableListView (Android)
- 7. Android ExpandableListview
- 8. ExpandableListView не расходуется на android
- 9. Добавить ExpandableListView на вкладку с другими элементами
- 10. Как добавить WebView в ExpandableListView?
- 11. Многоуровневый ExpandableListView в Android
- 12. Android ExpandableListView Child Headers
- 13. Добавить clickable imageView в expandableListView
- 14. Добавить водяной знак на изображения
- 15. Добавить знак * на обязательное поле
- 16. Добавить Вкладки ExpandableListView Под TabHost
- 17. Android - TableLayout для ExpandableListView
- 18. Пользовательские ExpandableListview Android
- 19. Android ExpandableListView переменная сфера
- 20. ExpandableListView в Android
- 21. Android ExpandableListView раздвижные дети
- 22. Android ExpandableListView - Поиск учебника
- 23. Android RadioButton в ExpandableListView
- 24. Добавить знак воды для изображения в android
- 25. Android ExpandableListView не расширяется
- 26. Как добавить динамические данные в ExpandableListView?
- 27. Android ExpandableListView с помощью анимации
- 28. Android, как добавить знак @ как текст
- 29. Expandablelistview Auto Expand - Android
- 30. Android ExpandableListView GroupIndicator gravity
благодаря Md Абдул Гафур, это полезно. – Joseph
Спасибо, если это нормально, то отметьте как полный этот ответ. –