从矩形边框更改安卓的EditText风格强调 [英] Change android EditText style from rectangular border to underscore

查看:183
本文介绍了从矩形边框更改安卓的EditText风格强调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我活动之一,我的EditText观点看惯了这样的

但现在他们看起来像这样

我需要帮助改回去:从矩形下划线

背景

由于我需要创建一个自定义的动作条,我不得不改变有关活动, YesterdayActivity ,使用以下

主题

风格:

 <样式名称=CustomWindowTitleBackground>
        <项目名称=机器人:背景>#323331< /项目>
    < /风格>

    <样式名称=CustomTheme父=安卓主题>
        <项目名称=机器人:windowTitleSize> 40dip< /项目>
        <项目名称=机器人:windowTitleBackgroundStyle> @风格/ CustomWindowTitleBackground< /项目>
    < /风格>
 

清单:

 <活动
        机器人:名称=com.example.YesterdayActivity
        机器人:主题=@风格/ CustomTheme>
    < /活性GT;
 

的onCreate:

  @覆盖
    保护无效的onCreate(包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);
...
}
 

解决方案

来自你的风采删除此行

 <项目名称=机器人:背景>#323331< /项目>
 

,因为它是反映该问题的背景属性。

In one of my activities, my EditText views used to look like this

But now they looks like this

I need help changing it back: from the rectangle to the underscore.

BACKGROUND

Because I needed to create a custom ActionBar, I had to change the theme of the activity in question, YesterdayActivity, using the following

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>

Manifest:

  <activity
        android:name="com.example.YesterdayActivity"
        android:theme="@style/CustomTheme">
    </activity>

onCreate:

@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);
…
}

解决方案

Remove this line from your style

<item name="android:background">#323331</item>

because it is the background attribute that reflects the behaviour.

这篇关于从矩形边框更改安卓的EditText风格强调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆