我如何设置一个全息主题的EditText在ICS中的样式,使其与API8级的设备兼容。
我尝试了以下代码,但它与API 8不兼容。
<EditText
android:id="@+id/editText1"
style="@android:style/Widget.Holo.EditText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>发布于 2013-04-19 06:49:40
您可以使用HoloEveryWhere。
或者你可以这样做:
<style name="MyTheme" parent="@android:style/Theme">
<item name="android:editTextBackground">@drawable/my_edittext</item>
</style>my_edittext.xml:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_light" />
<item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_disabled_holo_light" />
<item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_activated_holo_light" />
<item android:state_enabled="true" android:state_activated="true" android:drawable="@drawable/textfield_focused_holo_light" />
<item android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_light" />
<item android:state_focused="true" android:drawable="@drawable/textfield_disabled_focused_holo_light" />
<item android:drawable="@drawable/textfield_disabled_holo_light" />
</selector>您可以在SDK文件夹中找到提到的可绘制内容。
发布于 2013-04-19 06:51:49
自己创建类似的设计。您可以使用api 16的资源,您可以在/android-sdks/platform/android-16/data/res/文件夹中找到
https://stackoverflow.com/questions/16094324
复制相似问题