javascript - HTML 5 : Text box getting highlighted

标签 javascript android css html

Android:滚动时 jquery 移动文本框在固定标题上重叠

当用户点击任何文本框并开始滚动时,聚焦的文本框会与固定标题重叠(如上所示)。

https://www.dropbox.com/s/vk6nzeeqrx68uai/Screenshot_2013-10-01-10-19-39-2.png

有什么想法可以防止用户单击该文本框时突出显示该文本框。

图片:https://www.dropbox.com/s/43nee5bw4x9grzk/Screenshot_2013-10-01-13-37-11-1.png

我希望第二个文本框在点击后也与第一个文本框相同。

谢谢 拉兹

最佳答案

在可绘制对象中使用 Selector.xml 文件,然后使用两个不同的背景图像。一张是悬停图片,另一张是普通图片。

例如:

 <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@drawable/hover_Bg" android:state_pressed="true"></item>
<item android:drawable="@drawable/hover_Bg" android:state_focused="true"></item>
<item android:drawable="@drawable/normal_Bg"></item>

</selector>

在你的布局中这样设置。

 <EditText
            android:id="@+id/firstname_edt"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dip"
            android:background="@drawable/Selector"
            android:inputType="textPersonName" >
        </EditText>

关于javascript - HTML 5 : Text box getting highlighted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19113016/

相关文章:

javascript - htmlEle.fireEvent ("onclick"、 document.createEventObject()) 在 IE 11 上不起作用

javascript - Ajax 请求链接/嵌套?

android - 如何在自定义 View 中实现 ScaleGestureDetector

html - 如何调整 3D CSS 立方体的大小

css - 填充的无效属性值

php - 使用空格时图像 alt 和标题变得困惑

javascript - 为什么 fetch() 超出了最大调用堆栈?

javascript - 仅当光标远离 div 200px 时才关闭 div

android - 使用 CHOICE_MODE_MULTIPLE 自定义列表中的 View

android - 如何让Android分贝测量更准确?它完全正确吗?