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

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

固定軟鍵盤上方的布局

固定軟鍵盤上方的布局

一只斗牛犬 2021-04-06 17:18:37
我知道這個問題已經存在很長時間了,但就我而言似乎沒有任何作用。怎么了從屏幕快照中可以看到,具有微調器的布局沒有被向上推,而是被軟鍵盤覆蓋。我希望此布局在彈出時被放置在鍵盤上方。我的布局文件<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:background="@android:color/white"    android:orientation="vertical"    tools:context="believe.cht.speak.MainActivity">    <ImageView        android:id="@+id/logo"        android:layout_width="64dp"        android:layout_height="64dp"        android:layout_gravity="center_horizontal"        android:layout_margin="16dp"        android:src="@drawable/ic_bubble"        android:tint="@color/blue" />    <EditText        android:layout_width="match_parent"        android:layout_height="0dp"        android:layout_weight="1"        android:background="@android:color/transparent"        android:gravity="top|start"        android:hint="Start typing..."        android:padding="8dp" />    <ImageView        android:id="@+id/shadow"        android:layout_width="match_parent"        android:layout_height="6dp"        android:src="@drawable/shadow" />    <RelativeLayout        android:id="@+id/spinnerLayout"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_gravity="bottom"        android:background="@color/blue">        <Spinner            android:id="@+id/spinner"            android:layout_width="200dp"            android:layout_height="48dp"            android:layout_alignParentEnd="true" />    </RelativeLayout></LinearLayout>我嘗試過的android:windowSoftInputMode="adjustResize"android:windowSoftInputMode="adjustPan" //in the manifest, also tried combining the twogetWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); //in the activity<item name="android:windowActionBarOverlay">true</item> //in styles.xml
查看完整描述

3 回答

?
慕尼黑8549860

TA貢獻1818條經驗 獲得超11個贊

嘗試使用RelativeLayout而不是LinearLayout并將其添加android:alignParentBottom="true"到您的spinnerLayout


查看完整回答
反對 回復 2021-04-21
  • 3 回答
  • 0 關注
  • 525 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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