pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <small id='HPl0k'></small><noframes id='HPl0k'>

    <tfoot id='HPl0k'></tfoot>
  1. <i id='HPl0k'><tr id='HPl0k'><dt id='HPl0k'><q id='HPl0k'><span id='HPl0k'><b id='HPl0k'><form id='HPl0k'><ins id='HPl0k'></ins><ul id='HPl0k'></ul><sub id='HPl0k'></sub></form><legend id='HPl0k'></legend><bdo id='HPl0k'><pre id='HPl0k'><center id='HPl0k'></center></pre></bdo></b><th id='HPl0k'></th></span></q></dt></tr></i><div class="ieq2awc" id='HPl0k'><tfoot id='HPl0k'></tfoot><dl id='HPl0k'><fieldset id='HPl0k'></fieldset></dl></div>
      • <bdo id='HPl0k'></bdo><ul id='HPl0k'></ul>

    1. <legend id='HPl0k'><style id='HPl0k'><dir id='HPl0k'><q id='HPl0k'></q></dir></style></legend>
    2. 使用屏幕鍵盤鍵入時,Android 中的 EditText 不顯示

      EditText in Android doesn#39;t show text when typing while using the on-screen keyboard(使用屏幕鍵盤鍵入時,Android 中的 EditText 不顯示文本)

        <small id='fzT8u'></small><noframes id='fzT8u'>

        <i id='fzT8u'><tr id='fzT8u'><dt id='fzT8u'><q id='fzT8u'><span id='fzT8u'><b id='fzT8u'><form id='fzT8u'><ins id='fzT8u'></ins><ul id='fzT8u'></ul><sub id='fzT8u'></sub></form><legend id='fzT8u'></legend><bdo id='fzT8u'><pre id='fzT8u'><center id='fzT8u'></center></pre></bdo></b><th id='fzT8u'></th></span></q></dt></tr></i><div class="20eq2es" id='fzT8u'><tfoot id='fzT8u'></tfoot><dl id='fzT8u'><fieldset id='fzT8u'></fieldset></dl></div>

        • <tfoot id='fzT8u'></tfoot>
          <legend id='fzT8u'><style id='fzT8u'><dir id='fzT8u'><q id='fzT8u'></q></dir></style></legend>
            <bdo id='fzT8u'></bdo><ul id='fzT8u'></ul>
              <tbody id='fzT8u'></tbody>
              1. 本文介紹了使用屏幕鍵盤鍵入時,Android 中的 EditText 不顯示文本的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我有一個由 3 個 EditText 字段組成的活動(其中包括 TextViews 和一些按鈕).我還有一個 AutoCompleteTextView,其中包含使用 ArrayAdapter 的字符串列表.

                I have an activity consisting of 3 EditText fields (amongst other things like TextViews and a few buttons). I also have an AutoCompleteTextView with a list of String's using an ArrayAdapter.

                每當我在模擬器中測試應用程序時,我可以在鍵盤啟動時鍵入,但它不顯示文本(它仍然提供預測),并且文本僅在鍵盤關閉后出現在 EditText 框中.當我在手機上測試它時也會發生這種情況.但是,如果屏幕鍵盤沒有啟動并且您只是正常輸入,它會在您在模擬器上輸入時顯示出來.

                Whenever I test the app in an emulator, I can type when the keyboard is up but it doesn't show the text (it still gives predictions) and the text only appears in the EditText box once the keyboard is closed down. This happens when I test it on my phone, too. However, it works and shows up as you type on the emulator if the on-screen keyboard isn't up and you're just typing normally.

                我不知道為什么!

                這是我的活動 XML(EditText 是前 3 個塊)

                Here is my Activity XML (where the EditText's are the top 3 blocks)

                 <?xml version="1.0" encoding="utf-8"?>
                    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                    android:id="@+id/l"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_x="3dp"
                    android:layout_y="5dp"
                    android:background="@drawable/gymbg" >
                
                
                   <AutoCompleteTextView android:id="@+id/inputExercise"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:completionThreshold="1"
                        android:inputType="text"
                        android:layout_alignParentRight="true"
                        android:layout_below="@+id/timeSet"
                        android:layout_margin="10dp"
                        android:layout_marginTop="50dp"
                        android:width="200dp" />  
                
                    <EditText
                        android:id="@+id/inputWeight"
                        android:inputType="number"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentRight="true"
                        android:layout_below="@+id/inputExercise"
                        android:layout_margin="10dp"
                        android:layout_marginTop="50dp"
                        android:width="200dp" >
                    </EditText>
                
                    <EditText
                        android:id="@+id/inputReps"
                        android:inputType="number"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentRight="true"
                        android:layout_below="@+id/inputWeight"
                        android:layout_margin="10dp"
                        android:layout_marginTop="50dp"
                        android:width="200dp" >
                    </EditText>
                
                    <TextView
                        android:id="@+id/timeMain"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerHorizontal="true"
                        android:text="@string/timeMain"
                        android:textSize="32sp" 
                        android:textColor="#0F293B"/>
                
                    <TextView
                        android:id="@+id/timeSet"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/timeMain"
                        android:layout_centerHorizontal="true"
                        android:layout_marginTop="24dp"
                        android:text="@string/timeSet" 
                        android:layout_marginBottom="50dp"
                        android:textColor="#0F293B"/>
                
                    <TextView
                        android:id="@+id/labExercise"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignLeft="@+id/addbutton"
                        android:layout_alignParentLeft="true"
                        android:layout_below="@+id/timeSet"
                        android:layout_centerVertical="true"
                        android:layout_margin="10dp"
                        android:layout_marginLeft="15dp"
                        android:text="@string/labExercise"   
                        android:layout_toLeftOf="@+id/inputExercise"
                        android:textColor="#ffffff"/>
                
                    <Button
                        android:id="@+id/addbutton"
                        android:layout_width="fill_parent"
                        android:layout_height="50dp"
                        android:layout_alignParentBottom="true"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentRight="true"
                        android:layout_margin="10dp"
                        android:text="@string/add" />
                
                
                    <Button
                    android:id="@+id/startStop"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content" 
                    android:layout_above="@+id/addbutton" 
                    android:layout_alignParentLeft="true"
                    android:layout_margin="10dp"
                    android:text="@string/startStop" />
                
                    <TextView
                        android:id="@+id/labWeight"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:layout_below="@+id/inputExercise"
                        android:layout_margin="10dp"
                        android:text="@string/labWeight" 
                        android:textColor="#ffffff"/>
                
                    <TextView
                        android:id="@+id/labReps"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:layout_alignTop="@+id/inputReps"
                        android:layout_margin="10dp"
                        android:text="@string/labReps" 
                        android:textColor="#ffffff"/>
                
                    <TextView
                        android:id="@+id/seePrevious"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_above="@+id/inputExercise"
                        android:layout_centerHorizontal="true"
                        android:layout_marginBottom="22dp"
                        android:text="@string/tapToViewPrevious" 
                        android:textColor="#505050"/>
                
                </RelativeLayout>
                

                這是我在活動中使用的代碼:(我已經刪除了不必要的代碼)

                and here is the code I used in my activity: (I have stripped out unneccesary code)

                public class MyWorkoutDiary1Activity extends Activity implements OnClickListener, TextWatcher 
                {
                
                    TextView seePrevious;
                    DatabaseHandler db;
                
                    AutoCompleteTextView myAutoComplete;
                
                    ArrayList<String> exerciseType = new ArrayList<String>();
                
                
                    @Override
                    public void onCreate(Bundle savedInstanceState) {
                        super.onCreate(savedInstanceState);
                        setContentView(R.layout.main);
                
                
                        exercise = new EditText(this); 
                        exercise = (EditText)findViewById(R.id.inputExercise); 
                
                        db = new DatabaseHandler(this);
                        exerciseType = db.getUniqueExercises();
                
                        myAutoComplete = (AutoCompleteTextView)findViewById(R.id.inputExercise);
                
                        myAutoComplete.addTextChangedListener(this);
                        myAutoComplete.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, exerciseType));
                
                
                        weight = new EditText(this); 
                        weight = (EditText)findViewById(R.id.inputWeight); 
                
                
                        reps = new EditText(this); 
                        reps = (EditText)findViewById(R.id.inputReps); 
                
                    }
                
                }
                

                感謝閱讀

                推薦答案

                好的,所以我找出了問題所在!

                Ok, so I worked out what the issue was!

                我沒有發布的代碼因為我認為它無關緊要"包含一個線程

                The code which I didn't post because I thought it was 'irrelevant' contained a thread

                public static Runnable updateTimerMethod = new Runnable() 
                {
                
                    public void run() 
                    {
                        sessionTimer.setText(TimerHandler.theTime);  
                
                        myHandler.postDelayed(this, 0);
                
                    }
                 }; 
                

                通過將 postDelayed 設置為 0,我意識到線程基本上占用了所有活動(我真的不知道如何正確解釋).一旦我將其更改為... 100,然后 EditText工作.

                I realised that the thread was basically taking up all of the activity (I don't really know how to explain that properly) by having the postDelayed as 0. Once I changed this to say... 100, then the EditText worked.

                感謝幫助我的@NKN.

                Thank you to @NKN who helped me.

                這可能是針對我的,但希望這對其他人有所幫助.

                This may be specific to me, but hopefully this will help somebody else.

                這篇關于使用屏幕鍵盤鍵入時,Android 中的 EditText 不顯示文本的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                Converting a string to an integer on Android(在Android上將字符串轉換為整數)
                Android Jack mockito alternative(Android Jack mockito 替代品)
                Is it possible to use Espresso#39;s IdlingResource to wait until a certain view appears?(是否可以使用 Espresso 的 IdlingResource 等到某個視圖出現?)
                Integrate window tester with eclipse for testing UI(將 window tester 與 eclipse 集成以測試 UI)
                How to press a button twice using Google UiAutomator?(如何使用 Google UiAutomator 按兩次按鈕?)
                How can I bind a specific key to different launch configurations in Eclipse?(如何將特定鍵綁定到 Eclipse 中的不同啟動配置?)

                    <tfoot id='9yOMW'></tfoot>

                    <small id='9yOMW'></small><noframes id='9yOMW'>

                      <bdo id='9yOMW'></bdo><ul id='9yOMW'></ul>

                        1. <legend id='9yOMW'><style id='9yOMW'><dir id='9yOMW'><q id='9yOMW'></q></dir></style></legend>
                          <i id='9yOMW'><tr id='9yOMW'><dt id='9yOMW'><q id='9yOMW'><span id='9yOMW'><b id='9yOMW'><form id='9yOMW'><ins id='9yOMW'></ins><ul id='9yOMW'></ul><sub id='9yOMW'></sub></form><legend id='9yOMW'></legend><bdo id='9yOMW'><pre id='9yOMW'><center id='9yOMW'></center></pre></bdo></b><th id='9yOMW'></th></span></q></dt></tr></i><div class="suoq20w" id='9yOMW'><tfoot id='9yOMW'></tfoot><dl id='9yOMW'><fieldset id='9yOMW'></fieldset></dl></div>
                            <tbody id='9yOMW'></tbody>
                          主站蜘蛛池模板: 挨踢网-大家的导航!| NM-02立式吸污机_ZHCS-02软轴刷_二合一吸刷软轴刷-厦门地坤科技有限公司 | 江西自考网-江西自学考试网 | 石磨面粉机|石磨面粉机械|石磨面粉机组|石磨面粉成套设备-河南成立粮油机械有限公司 | 河南包装袋厂家_河南真空袋批发价格_河南服装袋定制-恒源达包装制品 | 合肥风管加工厂-安徽螺旋/不锈钢风管-通风管道加工厂家-安徽风之范 | 脱硫搅拌器厂家-淄博友胜不锈钢搅拌器厂家 | 建大仁科-温湿度变送器|温湿度传感器|温湿度记录仪_厂家_价格-山东仁科 | 304不锈钢无缝管_不锈钢管厂家 - 隆达钢业集团有限公司 | 济南网站建设|济南建网站|济南网站建设公司【济南腾飞网络】【荐】 | 帽子厂家_帽子工厂_帽子定做_义乌帽厂_帽厂_制帽厂_帽子厂_浙江高普制帽厂 | 食药成分检测_调料配方还原_洗涤剂化学成分分析_饲料_百检信息科技有限公司 | 档案密集架_电动密集架_移动密集架_辽宁档案密集架-盛隆柜业厂家现货批发销售价格公道 | hc22_hc22价格_hc22哈氏合金—东锜特殊钢 | 环氧铁红防锈漆_环氧漆_无溶剂环氧涂料_环氧防腐漆-华川涂料 | pH污水传感器电极,溶解氧电极传感器-上海科蓝仪表科技有限公司 | 喷播机厂家_二手喷播机租赁_水泥浆洒布机-河南青山绿水机电设备有限公司 | 防爆型气象站_农业气象站_校园气象站_农业四情监测系统「山东万象环境科技有限公司」 | 首页-浙江橙树网络技术有限公司 石磨面粉机|石磨面粉机械|石磨面粉机组|石磨面粉成套设备-河南成立粮油机械有限公司 | 尼龙PA610树脂,尼龙PA612树脂,尼龙PA1010树脂,透明尼龙-谷骐科技【官网】 | 台式低速离心机-脱泡离心机-菌种摇床-常州市万丰仪器制造有限公司 | 泰来华顿液氮罐,美国MVE液氮罐,自增压液氮罐,定制液氮生物容器,进口杜瓦瓶-上海京灿精密机械有限公司 | 扫地车厂家-山西洗地机-太原电动扫地车「大同朔州吕梁晋中忻州长治晋城洗地机」山西锦力环保科技有限公司 | 哈尔滨发电机,黑龙江柴油发电机组-北方星光 | 苏州伊诺尔拆除公司_专业酒店厂房拆除_商场学校拆除_办公楼房屋拆除_家工装拆除拆旧 | 首页-浙江橙树网络技术有限公司| 北京网站建设-企业网站建设-建站公司-做网站-北京良言多米网络公司 | 无线遥控更衣吊篮_IC卡更衣吊篮_电动更衣吊篮配件_煤矿更衣吊篮-力得电子 | 船用泵,船用离心泵,船用喷射泵,泰州隆华船舶设备有限公司 | 首页-恒温恒湿试验箱_恒温恒湿箱_高低温试验箱_高低温交变湿热试验箱_苏州正合 | 仓储货架_南京货架_钢制托盘_仓储笼_隔离网_环球零件盒_诺力液压车_货架-南京一品仓储设备制造公司 | 政府回应:200块在义乌小巷能买到爱情吗?——揭秘打工族省钱约会的生存智慧 | 货车视频监控,油管家,货车油管家-淄博世纪锐行电子科技 | FAG轴承,苏州FAG轴承,德国FAG轴承-恩梯必传动设备(苏州)有限公司 | PC构件-PC预制构件-构件设计-建筑预制构件-PC构件厂-锦萧新材料科技(浙江)股份有限公司 | 郑州宣传片拍摄-TVC广告片拍摄-微电影短视频制作-河南优柿文化传媒有限公司 | 青岛侦探_青岛侦探事务所_青岛劝退小三_青岛调查出轨取证公司_青岛婚外情取证-青岛探真调查事务所 | 上海道勤塑化有限公司 | 热回收盐水机组-反应釜冷水机组-高低温冷水机组-北京蓝海神骏科技有限公司 | 赛尔特智能移动阳光房-阳光房厂家-赛尔特建筑科技(广东)有限公司 | 中高频感应加热设备|高频淬火设备|超音频感应加热电源|不锈钢管光亮退火机|真空管烤消设备 - 郑州蓝硕工业炉设备有限公司 |