Android EditText 不起作用,android:imeOptions= "actionNext" android:inputType= "phone"



我已经尝试过了,只有当我删除android:inputType="phone"时,键盘Enter才能跳到Next EditText。我不知道android:imeOptions="actionNext"android:inputType="phone"之间是否发生了一些冲突。

代码:AutoCompleteTextViewandroid:imeOptions="actionNext"android:inputType="phone",但键盘上的Enter不会转到下一个。

         <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal" >
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:paddingBottom="12dp"
                    android:paddingLeft="13dp"
                    android:paddingTop="12dp"
                    android:src="@drawable/fd_28" />

                <TextView
                    android:id="@+id/texttitle_phone"
                    style="@style/TextviewRentItem"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="30dip" />
                <EditText
                    android:id="@+id/content_phone"
                    style="@style/TextviewRentItemCon3"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="50dip"
                    android:layout_toRightOf="@id/texttitle_phone"
                    android:paddingBottom="12dp"
                    android:paddingRight="15dp"
                    android:paddingTop="12dp"
                    android:imeOptions="actionNext"
                    android:singleLine="true" 
                    android:inputType="phone"/>
            </RelativeLayout>
        </LinearLayout>
        <LinearLayout
            android:id="@+id/linearLayout0_ll"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dip"
            android:background="@drawable/bg_rect_black_filled_white"
            android:orientation="vertical" >
            <!-- the second-->
            <RelativeLayout
                android:id="@+id/linearLayout0"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal" >
                <ImageView
                    android:id="@+id/img_house"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:paddingBottom="12dp"
                    android:paddingLeft="10dp"
                    android:paddingTop="12dp"
                    android:src="@drawable/fd_29" />
                <TextView
                    android:id="@+id/textview3"
                    style="@style/TextviewRentItem"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="30dip"
                    android:focusable="true"
                    android:text="@string/house" />
                <AutoCompleteTextView
                    android:id="@+id/add_rent_manage_house"
                    style="@style/TextviewRentItemCon3"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="50dip"
                    android:layout_toRightOf="@id/textview3"
                    android:dropDownHeight="90dp"
                    android:hint="@string/default_add_rent_house_remind"
                    android:imeOptions="actionNext"
                    android:singleLine="true" />
            </RelativeLayout>

(OP在编辑和评论中回答。请参阅没有答案的问题,但问题在评论中解决(或在聊天中扩展))

OP写道:

问题已经解决。My EditText使用setOnClickListener,删除此侦听器事件,即可

@xbakesx写道:

我认为你的问题的真正解决方案是添加android:singleLine="true"

最新更新