亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Android中的調整和調整盤的區別?

Android中的調整和調整盤的區別?

森林海 2019-07-20 09:52:08
Android中的調整和調整盤的區別?我試圖編寫一個代碼,用于在以下情況下重新調整ui組件的大小。軟鍵盤出現了。當我用調整大小,它重新調整了ui組件的大小,同時也對用戶界面組件進行了調整。調節盤給了我同樣的輸出。我想知道它們之間的區別,以及何時使用每個組件?哪一個(調整盤或調整大小)對調整UI有好處?以下是我的XML:<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:fillViewport="true" >     <RelativeLayout         android:layout_width="fill_parent"         android:layout_height="wrap_content" >         <LinearLayout             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:layout_alignParentBottom="true"             android:orientation="vertical" >             <EditText                 android:id="@+id/editText5"                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 android:layout_marginTop="45dp"                 android:ems="10"                 android:inputType="textPersonName" />             <Button                 android:id="@+id/button1"                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 android:layout_marginBottom="40dp"                 android:text="My Button" />         </LinearLayout>     </RelativeLayout></ScrollView>
查看完整描述

3 回答

?
繁花不似錦

TA貢獻1851條經驗 獲得超4個贊

“調整大小”

活動的主窗口總是調整大小,以便為屏幕上的軟鍵盤騰出空間。

“調整盤”

活動的主窗口不會調整大小,以便為軟鍵盤騰出空間。相反,窗口的內容會自動平移,這樣當前的焦點就不會被鍵盤遮住,用戶總是可以看到他們正在鍵入的內容。這通常不如調整大小,因為用戶可能需要關閉軟鍵盤才能到達窗口的模糊部分并與之交互。

根據您的評論,在您的活動清單中使用以下內容

<activity?android:windowSoftInputMode="adjustResize">?</activity>


查看完整回答
反對 回復 2019-07-20
?
眼眸繁星

TA貢獻1873條經驗 獲得超9個贊

調整尺寸=調整頁面內容的大小

調節盤=移動頁內容而不調整頁面內容的大小


查看完整回答
反對 回復 2019-07-20
?
飲歌長嘯

TA貢獻1951條經驗 獲得超3個贊

該設置必須是下表中列出的值之一,或者是一個“state.”的組合。值加一“調整.”價值。在任一組中設置多個值-多個“狀態.”例如,值具有未定義的結果。單獨的值由一個垂直條分隔。例如:

<activity?android:windowSoftInputMode="stateVisible|adjustResize"?.?.?.?>


查看完整回答
反對 回復 2019-07-20
  • 3 回答
  • 0 關注
  • 309 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號