Ответ 1
Прежде всего, текст "Готово" отображается только на больших устройствах.
Оформить заказ action_mode_close_item.xml
в Android-устройстве.
Таким образом, android:actionModeCloseButtonStyle
применяется только к содержащему виду, а не к представлению изображения и текстовому виду.
К счастью, инженеры android использовали общедоступные атрибуты для стилей childviews.
- Используйте
android:actionMenuTextColor
для изменения textColor в TextView. - Используйте
android:actionModeCloseDrawable
для изменения возможности рисования ImageView
Пример:
<style name="MyTheme">
<item name="android:actionMenuTextColor">#ff000000</item>
<item name="android:actionModeCloseDrawable">@drawable/my_close_drawable</item>
</style>
Ниже приведена копия action_mode_close_item.xml
в папке layout-large
, где вы можете увидеть, как компоновка создается.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/action_mode_close_button"
android:focusable="true"
android:clickable="true"
android:paddingStart="8dip"
style="?android:attr/actionModeCloseButtonStyle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="16dip">
<ImageView android:layout_width="48dip"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:scaleType="center"
android:src="?android:attr/actionModeCloseDrawable" />
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="4dip"
android:layout_marginEnd="16dip"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/actionMenuTextColor"
android:textSize="12sp"
android:textAllCaps="true"
android:text="@string/action_mode_done" />
</LinearLayout>