【发布时间】:2013-05-30 15:51:33
【问题描述】:
下面我在主题中添加了EditText 样式。我也添加了宽度和高度。所以我从我的edittext 视图中删除了android:layout_width 和android:layout_height。但它说的是错误。如果我添加宽度和高度,它工作正常。有什么区别。主题是否不适用于我的 edittext 视图?
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="android:editTextStyle">@style/custom_EditTextStyle</item>
</style>
<style name="custom_EditTextStyle" parent="@android:style/Widget.EditText">
<item name="android:background">@drawable/edittextbox</item>
<item name="android:singleLine">true</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">48dp</item>
</style>
我的编辑文本视图
<EditText android:hint="Username" />
【问题讨论】:
-
您的样式属性在哪里?
-
是 lint 还是编译错误?
标签: android android-layout android-theme android-styles