android-EditText不专注于触摸

android-EditText不专注于触摸,第1张

概述我的EditText看起来像:<EditTextandroid:id="@+id/uuidInput"android:layout_width="100dp"android:layout_height="wrap_content"android:textSize="14sp"android:inputType="text"/>但是,当我运

我的EditText看起来像:

<EditText    androID:ID="@+ID/uuIDinput"    androID:layout_wIDth="100dp"    androID:layout_height="wrap_content"    androID:textSize="14sp"    androID:inputType="text"/>

但是,当我运行我的应用程序时,EditText不会专注于触摸,我不知道为什么.

我有一个布局文件beacon_data_input.xml,它包含在activity_main.xml中

这是我的输入视图beacon_data_input.xml:

<linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:orIEntation="vertical" androID:layout_wIDth="match_parent"    androID:ID="@+ID/inputLayout"    androID:layout_height="match_parent"    androID:g@R_301_6610@ty="center"    androID:visibility="visible">    <linearLayout        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:orIEntation="horizontal">        <com.nicbit.proximitydemo.common.customvIEws.RobotoCondensedTextVIEw            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:text="Beacon UUID:"/>        <com.nicbit.proximitydemo.common.customvIEws.RobotoCondensedTextVIEw            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:text="* "            androID:textcolor="@color/red" />        <EditText            androID:ID="@+ID/uuIDinput"            androID:layout_wIDth="100dp"            androID:layout_height="wrap_content"            androID:textSize="14sp"            androID:focusableIntouchMode="true"            androID:inputType="text"/>    </linearLayout>    <linearLayout        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:orIEntation="horizontal">        <com.nicbit.proximitydemo.common.customvIEws.RobotoCondensedTextVIEw            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:text="Beacon Major:"/>        <com.nicbit.proximitydemo.common.customvIEws.RobotoCondensedTextVIEw            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:text="* "            androID:textcolor="@color/red"/>        <EditText            androID:ID="@+ID/majorinput"            androID:layout_wIDth="100dp"            androID:layout_height="wrap_content"            androID:textSize="14sp"            androID:focusableIntouchMode="true"            androID:inputType="number"/>    </linearLayout>    <linearLayout        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:orIEntation="horizontal">        <com.nicbit.proximitydemo.common.customvIEws.RobotoCondensedTextVIEw            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:text="Beacon Minor:"/>        <com.nicbit.proximitydemo.common.customvIEws.RobotoCondensedTextVIEw            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:text="* "            androID:textcolor="@color/red"/>        <EditText            androID:ID="@+ID/minorinput"            androID:layout_wIDth="100dp"            androID:layout_height="wrap_content"            androID:textSize="14sp"            androID:focusableIntouchMode="true"            androID:inputType="number"/>    </linearLayout>

activity_main.xml包括以下布局:

<relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:tools="http://schemas.androID.com/tools"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    androID:orIEntation="vertical"    androID:fitsSystemwindows="true">    <include layout="@layout/custom_toolbar" />    <include layout="@layout/beacon_data_input" />    <androID.support.v7.Widget.RecyclerVIEw        androID:layout_margintop="56dp"        androID:ID="@+ID/proximityRecycler"        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:layout_marginBottom="50dp"></androID.support.v7.Widget.RecyclerVIEw>    <com.nicbit.proximitydemo.common.customvIEws.RobotoCondensedbutton        androID:g@R_301_6610@ty="center"        androID:ID="@+ID/Startbutton"        androID:layout_wIDth="match_parent"        androID:layout_height="50dp"        androID:layout_g@R_301_6610@ty="bottom"        androID:background="#292d2e"        androID:textcolor="#48c68f"        androID:textSize="24sp"        androID:layout_alignParentBottom="true"        androID:text="Start"        />    <linearLayout        androID:orIEntation="vertical"        androID:ID="@+ID/imageLayout"        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent">    </linearLayout></relativeLayout>

提前致谢.

解决方法:

您的EditText没有接触,因为在activity_main.xml文件中,RecyclerVIEw& linearLayout ..

尝试按如下所示放置它(在每个布局上方添加edittextLayout):

    <relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"        xmlns:tools="http://schemas.androID.com/tools"        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:orIEntation="vertical"        androID:fitsSystemwindows="true">        <androID.support.v7.Widget.RecyclerVIEw            androID:layout_margintop="56dp"            androID:ID="@+ID/proximityRecycler"            androID:layout_wIDth="match_parent"            androID:layout_height="match_parent"            androID:layout_marginBottom="50dp"></androID.support.v7.Widget.RecyclerVIEw>        <com.nicbit.proximitydemo.common.customvIEws.RobotoCondensedbutton            androID:g@R_301_6610@ty="center"            androID:ID="@+ID/Startbutton"            androID:layout_wIDth="match_parent"            androID:layout_height="50dp"            androID:layout_g@R_301_6610@ty="bottom"            androID:background="#292d2e"            androID:textcolor="#48c68f"            androID:textSize="24sp"            androID:layout_alignParentBottom="true"            androID:text="Start"            />        <linearLayout            androID:orIEntation="vertical"            androID:ID="@+ID/imageLayout"            androID:layout_wIDth="match_parent"            androID:layout_height="match_parent">        </linearLayout><!--- Add them in last -->        <include layout="@layout/custom_toolbar" />        <include layout="@layout/beacon_data_input" />    </relativeLayout>

或在设置该RecyclerVIEw&的可见性后尝试RobotoCondensedbutton的& linearLayout的可见性已消失.

总结

以上是内存溢出为你收集整理的android-EditText不专注于触摸全部内容,希望文章能够帮你解决android-EditText不专注于触摸所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1120918.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存