Tạo kiểu tùy chỉnh và đặt kiểu gốc thành chủ đề ánh sáng holo nhưng ActionBar thành Holo bình thường.
một file xml với một cái gì đó như thế này nên thực hiện công việc (chỉ cần ra khỏi bộ nhớ của tôi):
<style name="appstyle0" parent="android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@android:style/Widget.Holo.ActionBar</item>
</style>
Sau đó thiết lập các appstyle0 trong AndroidManifest.xml của bạn như phong cách và trong tất cả Activitys bạn là chủ đề ánh sáng holo nhưng phong cách thanh hành động là holo tối.
Chỉnh sửa: Tôi đã kiểm tra tại sao câu trả lời đầu tiên của tôi không hoạt động.
<style name="Widget.Holo.Light.ActionBar" parent="Widget.Holo.ActionBar">
<item name="android:titleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionBar.Title</item>
<item name="android:subtitleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionBar.Subtitle</item>
<item name="android:background">@android:drawable/ab_transparent_light_holo</item>
<item name="android:backgroundStacked">@android:drawable/ab_stacked_transparent_light_holo</item>
<item name="android:backgroundSplit">@android:drawable/ab_bottom_transparent_light_holo</item>
<item name="android:homeAsUpIndicator">@android:drawable/ic_ab_back_holo_light</item>
<item name="android:progressBarStyle">@android:style/Widget.Holo.Light.ProgressBar.Horizontal</item>
<item name="android:indeterminateProgressStyle">@android:style/Widget.Holo.Light.ProgressBar</item>
</style>
Thanh hành động được định nghĩa trong styles.xml với các thuộc tính được đặt theo chủ đề chính nói chung. Trước hết BG là trong suốt, vì vậy bạn nên sử dụng "Widget.Holo.Light.ActionBar.Solid" làm cha mẹ. Sau đó, bạn phải thiết lập các mục khác nhau từng người một cho chủ đề tối. Cho phép lấy titleTextStyle làm ví dụ:
<style name="TextAppearance.Holo.Widget.ActionBar.Title.Own"
parent="TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">@android:color/primary_text_holo_dark</item>
<item name="android:textColorHighlight">@android:color/highlighted_text_holo_dark</item>
<item name="android:textColorHint">@android:color/hint_foreground_holo_dark</item>
<item name="android:textColorLink">@android:color/holo_blue_light</item>
</style>
Đặt ngay bây giờ là.
<item name="android:titleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionBar.Title.Own</item>
Tiếp tục như thế này với thuộc tính xml ở trên.
Để tìm tất cả tìm kiếm thuộc tính liên quan trong styles.xml và themes.xml cho các tham số. Xin lỗi để nói, nhưng tôi đoán không có cách nào dễ dàng, theo những gì tôi thấy ...
Không làm việc cho tôi.Ví dụ: ' ' Điều này mang lại cho tôi paddingLeft nhưng không áp dụng Chủ đề tối Holo cho thanh tác vụ - nó vẫn là chủ đề ánh sáng. – Thomas
Xin lỗi để nói, nó không dễ dàng như vậy. Tôi đã cập nhật câu trả lời. – KarlKarlsom
Thx - Tôi sẽ thử cái này. – Thomas