Android view顯示在軟鍵盤上方

來源:互聯網
上載者:User

標籤:cti   single   設定   tab   parent   mod   高度   軟鍵盤   span   

  給EditText外加一個ScrollView,將高度設定統一,並給ScrollView設定屬性

android:fillViewport="true"。 
註:ScrollView只將EditView嵌套在其中即可,不可將其他組件放進來;不可隨意在資訊清單檔中給該activity設定軟鍵盤屬性。若彈出的軟鍵盤遮擋了部分上移的view,可以在資訊清單檔中給activity設定屬性
android:windowSoftInputMode="adjustResize"
一些不必要的屬性不要隨意添加,以免影響實現功能效果。

代碼:
<ScrollView            android:layout_width="fill_parent"                      android:layout_height="44dp"            android:fillViewport="true"            android:scrollbars="vertical">        <EditText            android:id="@+id/et_password"            android:layout_width="match_parent"            android:layout_height="44dp"            android:background="@drawable/edt_bg"            android:drawableLeft="@drawable/key"            android:drawablePadding="0dp"            android:hint="輸入交易密碼"            android:editable="true"            android:password="true"            android:cursorVisible="true"            android:paddingLeft="5dp"            android:singleLine="true" />        </ScrollView>

 

Android view顯示在軟鍵盤上方

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.