的EditText样式 [英] EditText Styling
问题描述
是可以操纵的文本字段的找到了风格的API 17
机器人在的API 8
? ?
Is it possible to manipulate the style of a text field found in API 17
of android in API 8
??
在较低的API的文本字段都具有较高的API相比有很大不同。有没有什么办法让一个统一的外观和感觉为这些组件?
The text field in lower API's are very different in comparison with the higher API's. Is there any way to give a uniform look and feel for these components?
推荐答案
只有EditText上?或者你希望每个小部件看起来像pre全息小部件?如果是这样,那么设置这是你的主题将帮助:
Only the EditText? Or do you want every widget to look like pre holo widgets? If so, then setting this as your theme will help:
<application
[...]
android:theme="@android:style/Theme" >
[...]
</application>
不过,如果你只是想拥有的EditText是非holofied你可以这样做:
However if you just want to have the EditText to be "un-holofied" you can do this:
<EditText
android:id="@+id/spinnermap"
style="@style/MyEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true" />
值/ styles.xml:
values/styles.xml:
<style name="MyEditText" parent="android:Widget.Spinner"></style>
和设置你的主题霍洛(.Light)和主题(.Light)为pre HC。
and set your Theme to Holo(.Light) and Theme(.Light) for pre HC.
或者,如果你想要的一切组合到一个主题,与以外的所有的EditText小部件是全息,那么你可以这样做:
Or if you want to combine everything into one theme with everything except the EditText widget being holo, then you can do this:
值-V11 / styles.xml:// V11,因为pre HC的主题已经有了的EditText的风格,你想
values-v11/styles.xml: // v11 because pre HC themes already have the EditText style, you want.
<style name="MyTheme" parent="@android:style/Theme.Holo"
<item name="android:editTextStyle">@style/MyEditText></item>
</style>
这篇关于的EditText样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!