Mixing Android widget old & new themes

旧时模样 提交于 2019-12-24 02:02:10

问题


I'm starting my second Android app and find that I would like to mostly use HOLO dark theme for app.

EXCEPT for the EditTexts, I would prefer to use the old Gingerbread style ones (looking closer to iOS) with some rounded corner.

I'm a bit lost as to how I can achieve this. If anyone could drop some hints or links that would be HIGHLY appreciated


回答1:


In your Theme:

<style name="myTheme"  parent="android:Theme.Holo">
<item name="editTextStyle">@style/MyWidget.EditText</item>
</style>

<style name="MyWidget.EditText" parent="android:Widget.EditText">
        <item name="android:background">@drawable/edit_text</item>
</style>

Now you can get the referenced drawable from Github(from the Gingerbread branch of the framework)



来源:https://stackoverflow.com/questions/14056191/mixing-android-widget-old-new-themes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!