Trong dự án của tôi cho đến một vài ngày trước, tôi đã sử dụng thanh hành động sherlock nhưng tôi đã dicided để thay đổi toàn bộ phong cách actionbar thành thiết kế material design mới. Về chủ đề cũ của tôi cho biểu tượng trở lại và tràn Tôi đã có một số biểu tượng tùy chỉnh được giải quyết trên chủ đề của tôi. Nhưng trên appcompat tôi đã cố gắng xác định nó về chủ đề của tôi, nơi tôi sử dụng nó trên một thanh công cụ nhưng nó không hoạt động. Bất cứ ai cũng biết làm thế nào để làm điều này có thể?Android: AppCompat 21, cách thay đổi biểu tượng quay lại và biểu tượng tràn vào biểu tượng tùy chỉnh?
chủ đề của tôi mà tôi sử dụng trên thanh công cụ (tạo với phòng thu tài sản): xml
<style name="Theme.Themewiz" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/ActionBar.Solid.Themewiz</item>
<item name="android:actionBarItemBackground">@drawable/selectable_background_themewiz</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Themewiz</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Themewiz</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Themewiz</item>
<item name="android:actionDropDownStyle">@style/DropDownNav.Themewiz</item>
<item name="android:actionModeBackground">@drawable/cab_background_top_themewiz</item>
<item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_themewiz</item>
<item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Themewiz</item>
<!-- Light.DarkActionBar specific -->
<item name="android:actionBarWidgetTheme">@style/Theme.Themewiz.Widget</item>
<item name="android:actionOverflowButtonStyle">@style/Theme.AppCompat.Overflow</item>
</style>
<style parent="@style/Widget.AppCompat.ActionButton.Overflow" name="Theme.AppCompat.Overflow">
<item name="android:src">@drawable/ic_action_overflow</item>
</style>
Toolbar:
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/my_awesome_toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimaryDark"
app:theme="@style/Theme.Themewiz"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
Mã? XML? Không có nó thì không thể giúp được gì. –
Tôi chỉnh sửa bài đăng gốc của mình bằng xmlfrom chủ đề và xml từ thanh công cụ. – billiout