安卓:背景图像的大小调整键盘上弹出 [英] Android: Background image resize on keyboard pop up
问题描述
我开发中的背景影像获取键盘弹出收缩的应用程序。我的.xml如下:
I am developing an application in which the background image get shrink on keyboard pop-up. My .xml is as follows :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:facebook="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
/**
Other stuff
*/
</RelativeLayout>
</ScrollView>
</RelativeLayout>
我搜索谷歌和发现,补充
I searched on Google and found that, to add
android:windowSoftInputMode="stateVisible|adjustPan"
在我的清单文件。但没有用它。
in my manifest file. But its of no use.
编辑:
键板之前,我的布局弹出如下:
My Layout before key board pop up looks like :
和弹出等之后:
请检查在背景图像的差异。在图像1图像大小,图像2背景图像缩小-ED。我需要页脚和背景获得键盘弹出向上移动。
Please check the difference in background image. In image 1 image is in size and in image 2 background image shrink-ed. I need the footer and background get shift upward on keyboard popup.
我所丢失或做错了,请给我建议。
What I am missing or doing wrong please suggest me.
推荐答案
就在使用的onCreate()
这code:
protected void onCreate(Bundle savedInstanceState) {
...
getWindow().setBackgroundDrawableResource(R.drawable.your_image_resource);
...
}
和消除这种线在你的XML:
and eliminate this line in your xml:
android:background="@drawable/background"
更多详情:
http://developer.android.com/reference/android/view/ Window.html
这篇关于安卓:背景图像的大小调整键盘上弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!