C S*_*per 3 android android-layout
我用以下代码制作样式:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CodeFont" parent="@android:style/TextAppearance.Medium">
<item name="android:layout_width">150dip</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#00FF00</item>
<item name="android:typeface">monospace</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
并将其应用为:
<EditText
style="CodeFont"
android:id="@+id/txt_username"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
Run Code Online (Sandbox Code Playgroud)
但它没有得到应用。
如果我写相同的风格:
<EditText
android:id="@+id/txt_username"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:ems="10"
android:inputType="textPersonName" />
Run Code Online (Sandbox Code Playgroud)
然后将其应用。
我的代码有什么问题吗?
请帮我。
使用以下
style="@style/CodeFont"
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请检查文档
http://developer.android.com/guide/topics/ui/themes.html
还要检查styles.xml
| 归档时间: |
|
| 查看次数: |
2308 次 |
| 最近记录: |