在我的一项活动中,我的 EditText 视图过去看起来像这样
但现在他们看起来像这样
我需要帮助将其改回来:从矩形到下划线。
背景
因为我需要创建一个自定义 ActionBar,所以我必须更改相关活动的主题,YesterdayActivity
,使用以下
Style:
<style name="CustomWindowTitleBackground">
<item name="android:background">#323331</item>
</style>
<style name="CustomTheme" parent="android:Theme">
<item name="android:windowTitleSize">40dip</item>
<item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
</style>
显现:
<activity
android:name="com.example.YesterdayActivity"
android:theme="@style/CustomTheme">
</activity>
创建时:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.activity_yesterday);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.yesterday_title_bar);
…
}
像这样更改您的自定义主题
<style name="CustomTheme" parent="android:Theme.Holo.NoActionBar">
因为你没有使用旧的 Android 主题HoLo
有那种editTextView
在较新版本的 Android 中,该框架将使用Window.FEATURE_ACTION_BAR
每当选择 Holo 主题时都会出现此功能。每当应用程序调用时,框架都会抛出异常setFeatureInt(Window.FEATURE_CUSTOM_TITLE)
and FEATURE_ACTION_BAR
已经设置好了。
它崩溃是因为 Holo 默认使用 ActionBar。修复方法很简单。使用 Holo 时关闭 ActionBar
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)