久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Android 調節(jié)器第一次后無法正常工作

Android adjustpan not working after the first time(Android 調節(jié)器第一次后無法正常工作)
本文介紹了Android 調節(jié)器第一次后無法正常工作的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我的問題:從屏幕上第二次顯示軟鍵盤開始,它完全隱藏了我的 EditText.

My problem: starting from the second time the software keyboard is shown on the screen, it entirely hides my EditText.

屬性android:windowSoftInputMode="adjustPan" 已在AndroidManifest.xml 中指定,但只在第一次生效.

Attribute android:windowSoftInputMode="adjustPan" has been specified in the AndroidManifest.xml, but it works only the first time.

我有以下布局:

 <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="464dp"
        android:gravity="top"
        android:orientation="vertical"
        android:paddingLeft="16dp"
        android:paddingRight="16dp" >

        <ListView
            android:id="@+id/list"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="10"
            android:background="#E3E3E2"
            android:gravity="top" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <EditText
                android:id="@+id/addListText"
                android:layout_width="0dp"
                android:layout_height="48dp"
                android:layout_weight="10"
                android:contentDescription="@string/addItemContentDescription"
                android:gravity="bottom|center_horizontal"
                android:inputType="textLongMessage"
                android:textColor="#E3E3E2"
                android:visibility="gone" />

            <ImageButton
                android:id="@+id/addTextListButton"
                android:layout_width="0dp"
                android:layout_height="48dp"
                android:layout_weight="1"
                android:layout_gravity="right"
                android:background="@android:color/transparent"
                android:contentDescription="@string/addItemButton"
                android:scaleType="fitCenter"
                android:src="@drawable/plus_add"
                android:visibility="gone" />
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:gravity="bottom|center_horizontal"
        android:orientation="horizontal"
        android:paddingLeft="16dp"
        android:paddingRight="16dp" >

        <ImageButton
            android:id="@+id/syncListsButton"
            android:layout_width="64dp"
            android:layout_height="match_parent"
            android:src="@android:drawable/ic_popup_sync" />

        <ImageButton
            android:id="@+id/showOrHide"
            android:layout_width="64dp"
            android:layout_height="match_parent" />

        <ImageButton
            android:id="@+id/delListButton"
            android:layout_width="64dp"
            android:layout_height="match_parent"
            android:src="@android:drawable/ic_menu_delete" />
    </LinearLayout>
</LinearLayout>

showOrHide"按鈕顯示/隱藏addListText"/addTextListButton"組合.

The "showOrHide" button shows/hides the "addListText"/"addTextListButton" combo.

當?shù)谝淮物@示 EditText 并且我觸摸它時,屏幕上出現(xiàn)軟鍵盤,并且addListText"/addTextListButton"組合被正確平移.當我隱藏鍵盤然后再次顯示時,鍵盤完全覆蓋了我的 addListText 編輯框!

When the EditText is shown for the first time and I touch it, the soft keyboard appears on the screen and the "addListText"/"addTextListButton" combo is panned correctly. When I hide the keyboard and then show it again, the keyboard covers completely my addListText editbox!

知道發(fā)生了什么嗎?我正在 Android 4.2.2 上測試它.

Any idea on what's going on? I'm testing it on Android 4.2.2.

請幫忙!謝謝:-)

我也嘗試將第一個 LinearLayout 放在 ScrollView 中,但它不起作用!

edit: I've also tried to put the first LinearLayout inside a ScrollView but it doesn't work!

推薦答案

繼承 EditText 并重寫 onKeyPreIme(int keyCode, KeyEvent event) 方法,如下所示:

subclassed EditText and overridden the method onKeyPreIme(int keyCode, KeyEvent event) like this:

   @Override
   public boolean onKeyPreIme(int keyCode, KeyEvent event)
   {
      if(keyCode == KeyEvent.KEYCODE_BACK)
        {
            clearFocus();
        }
   return super.onKeyPreIme(keyCode, event);
   }

現(xiàn)在當按下返回鍵時,EditText 失去了焦點.然后再次點擊它,調整盤將起作用.

Now when the back key is pressed, the EditText lost the focus. Then tapping it again adjustpan will work.

這篇關于Android 調節(jié)器第一次后無法正常工作的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

相關文檔推薦

EditText: Disable Paste/Replace menu pop-up on Text Selection Handler click event(EditText:禁用文本選擇處理程序單擊事件上的粘貼/替換菜單彈出)
Multiline EditText with Done SoftInput Action Label on 2.3(2.3 上帶有完成 SoftInput 操作標簽的多行 EditText)
How to detect the swipe left or Right in Android?(如何在 Android 中檢測向左或向右滑動?)
Prevent dialog dismissal on screen rotation in Android(防止在Android中的屏幕旋轉對話框解除)
How do I handle ImeOptions#39; done button click?(如何處理 ImeOptions 的完成按鈕點擊?)
How do you set EditText to only accept numeric values in Android?(您如何將 EditText 設置為僅接受 Android 中的數(shù)值?)
主站蜘蛛池模板: 免费久久精品视频 | 中文二区| 欧美一级黄色免费看 | 久久久久久国产精品三区 | 国产精品日韩欧美一区二区三区 | 91精品国产自产精品男人的天堂 | 91在线一区 | 日韩1区| 色天堂影院 | 国产一区二区三区四区五区3d | 国内精品久久久久 | 91久久精品一区二区二区 | 污书屋| 老妇激情毛片免费 | 国产一区久久久 | 97视频在线观看网站 | 涩涩片影院 | 天天操人人干 | 国产一区二区三区四 | 成人免费黄色 | 91传媒在线观看 | 欧美精品一区二区三区蜜桃视频 | 81精品国产乱码久久久久久 | 国产目拍亚洲精品99久久精品 | 欧美日韩国产传媒 | 999视频在线播放 | 日韩精品在线视频免费观看 | 久久久男人的天堂 | 成人在线视频网 | 99欧美精品 | 亚洲人成人一区二区在线观看 | 国产精品69毛片高清亚洲 | 九九久久久 | 午夜天堂精品久久久久 | 国产区在线 | 亚洲午夜av久久乱码 | 久久久久电影 | 91精品国产乱码久久久久久久 | 精品欧美一区二区三区久久久 | 日韩精品一区二区三区在线播放 | 国产精品久久久久久久一区二区 |