解决输入法弹出时背景被顶上去或者挤压变形的问题
先看效果图:
Screenshot_1510219375.png
Screenshot_1510219378.png
实现方案:
package com.qiangqiang.chatback.views;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ScrollView;
/**
* Created by qiangqiang on 2017/7/17 0017.
*/
public class NoScrollView extends ScrollView {
public NoScrollView(Context context) {
super(context);
}
public NoScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public NoScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
return true;
}
}
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/img_back"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/bg"
android:scaleType="centerCrop" />
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:hint="输入你想输入的文字" />