简体   繁体   English

如何为旧版本创建ICS全息样式的编辑文本?

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

I have searched lot of sites for creating ICS holo style EditText in Android older versions. 我搜索了许多网站,以在Android旧版本中创建ICS全息风格的EditText But the results did not helped me. 但是结果并没有帮助我。 Please provide me some sample links/code. 请提供一些示例链接/代码。

Copy the images from the android-sdk folder, and use them. 从android-sdk文件夹复制图像,然后使用它们。

Search here for textfield_bg_* 在此处搜索textfield_bg_ *

/android-sdks/platforms/android-16/data/res/drawable-mdpi / Android的软件开发工具包/平台/机器人-16 /数据/ RES /抽拉-MDPI

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 基本上,您想下载此xml选择器drawable并将其作为每个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. 然后,您需要找到该选择器中引用的每个可绘制对象,并将它们下载到相应大小类别的res文件夹中。 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 您可以使用该github项目进行搜索-例如,可以在https://github.com/android/platform_frameworks_base/blob/master/core/res/res/drawable-xhdpi/textfield_multiline_default_holo_light中找到textfield_multiline_default_holo_light的xhdpi版本.9.png

You should probably use the HoloEveryWhere Library . 您可能应该使用HoloEveryWhere库 It allows you to use the Holo themes on older API levels. 它允许您在较旧的API级别上使用Holo主题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM