我一直在尋找這個問題的解決方案,但是我沒有找到任何可以解決我的問題的方法。顯示鍵盤時頁腳上升
我使用的RelativeLayout作爲我的主要佈局和我的頁腳是RelativeLayout的也一樣,我在互聯網上找到這些配置:
機器人:windowSoftInputMode =「adjustPan | adjustResize」
它適用於頁腳保持不變,但我的滾動不起作用,這是我的主要問題,我能做些什麼來解決它?
我的佈局:在AndroidManifest
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:focusable="true"
android:fitsSystemWindows="true"
android:orientation="vertical" >
<ScrollView
android:id="@+id/scrollView1"
android:fillViewport="true"
android:isScrollContainer="true"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/ttvp1"
style="@style/ttvPersonalizado"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/p1" />
<TextView
android:id="@+id/ttvp2"
style="@style/ttvPersonalizadoDireito"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/p2" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<EditText
android:id="@+id/edtP1"
style="@style/edtPersonalizado"
android:maxLength="5"
android:layout_height="wrap_content"
android:background="@drawable/edit_text_design"
android:ems="10"
android:inputType="numberDecimal" >
</EditText>
<EditText
android:id="@+id/edtP2"
style="@style/edtPersonalizado"
android:maxLength="5"
android:layout_height="wrap_content"
android:background="@drawable/edit_text_design"
android:ems="10"
android:inputType="numberDecimal" />
</LinearLayout>
<TextView
android:id="@+id/ttvpim"
style="@style/ttvPersonalizado"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/pip3" />
<EditText
android:id="@+id/edtPiP3"
style="@style/edtPersonalizado"
android:maxLength="5"
android:layout_height="wrap_content"
android:background="@drawable/edit_text_design"
android:inputType="numberDecimal" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/ttvExame"
style="@style/ttvPersonalizado"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="18dp"
android:text="@string/notaExame" />
<CheckBox
android:id="@+id/chkExame"
style="@style/chkPersonalizado"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:text="@string/exame" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/edtExame"
style="@style/edtPersonalizado"
android:maxLength="5"
android:layout_height="wrap_content"
android:background="@drawable/edit_text_design"
android:ems="10"
android:enabled="false"
android:inputType="numberDecimal"
android:width="125dp" />
<CheckBox
android:id="@+id/chkPersonalizado"
style="@style/chkPersonalizado"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tecnologo" />
</LinearLayout>
<TextView
style="@style/ttvPersonalizado"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/mediaFinal" />
<EditText
android:id="@+id/edtMedia"
style="@style/edtPersonalizado"
android:maxLength="5"
android:layout_height="wrap_content"
android:background="@drawable/edit_text_design"
android:enabled="false"
android:inputType="numberDecimal" />
<TextView
android:id="@+id/ttvStatus"
style="@style/ttvPersonalizado"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ImageButton
android:id="@+id/btnGerarMedia"
style="@style/btnMedio"
android:background="@drawable/shapebutton"
android:contentDescription="@string/gerarMedia"
android:src="@drawable/icone_calculadora"
android:text="@string/gerarMedia" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dip"
android:layout_alignParentBottom="true"
android:background="@drawable/background_footer"
android:orientation="vertical" >
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent" />
</RelativeLayout>
</RelativeLayout>
我的活動配置:
<activity
android:name="br.com.media_universidades.visao.MediaCalculoActivity"
android:icon="@drawable/ic_launcher"
android:label="@string/umc" android:windowSoftInputMode="adjustPan|adjustResize"/>
預先感謝您。
將您的佈局添加到問題中,以便我們可以看到您正在處理的內容。 –
部分你的佈局,並確認它有滾動視圖 –
更改'android:windowSoftInputMode'值爲'android:windowSoftInputMode =「stateVisible | adjustResize'。希望它有幫助 – piotrek1543