How to create ICS holo style edit text for older versions?

冷暖自知 提交于 2019-12-11 01:38:01

问题


I have searched lot of sites for creating ICS holo style EditText in Android older versions. But the results did not helped me. Please provide me some sample links/code.


回答1:


Copy the images from the android-sdk folder, and use them.

Search here for textfield_bg_*

/android-sdks/platforms/android-16/data/res/drawable-mdpi




回答2:


Basically you want to download this xml selector drawable and put it as the background of each EditText: https://github.com/android/platform_frameworks_base/blob/master/core/res/res/drawable/edit_text_holo_light.xml

(If you want holo dark then just replace each instance of "light" with "dark", obviously.)

Then you need to find each of the drawables referenced in that selector and download them into your res folder in the appropriate size category. You can use that github project to search for them - for example, the xhdpi version of textfield_multiline_default_holo_light can be found at https://github.com/android/platform_frameworks_base/blob/master/core/res/res/drawable-xhdpi/textfield_multiline_default_holo_light.9.png




回答3:


You should probably use the HoloEveryWhere Library. It allows you to use the Holo themes on older API levels.



来源:https://stackoverflow.com/questions/13135972/how-to-create-ics-holo-style-edit-text-for-older-versions

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