【问题标题】:Although I don't want the edit box to remain focused, I'd like the blue focus boarder to stay?虽然我不希望编辑框保持焦点,但我希望蓝色焦点边框保持不变?
【发布时间】:2014-03-14 00:40:36
【问题描述】:

我添加了一个编辑文本框并将其放置在 xml 文件中,尽管在加载应用程序时会出现蓝色焦点边框。我希望焦点边界保持不变,即使编辑文本没有聚焦。我该怎么做?

编辑文本的当前 XML:

<EditText
            android:id="@+id/MyTextbox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:textColor="@android:color/white" >
        </EditText>

【问题讨论】:

    标签: java android xml eclipse android-activity


    【解决方案1】:

    更改编辑文本的背景。 将此行添加到您的编辑中

    android:background="@android:drawable/textfield_activated_holo_light"
    

    【讨论】:

    • 我收到错误消息:资源不公开。 (在“背景”,值为“@android:drawable/textfield_activated_holo_light”)。
    • 我的错。您需要将图像文件复制到您的项目drawable中。然后 android:backgorund="@drawable/textfield_default_holo_light"
    • 现在全部排序 :-) 感谢您的帮助。以防万一,您对使用片段有好处吗?遇到了一个让我很困惑的问题
    猜你喜欢
    • 2013-06-08
    • 2020-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-27
    • 1970-01-01
    • 2011-05-14
    • 1970-01-01
    相关资源
    最近更新 更多