问题记录
1,键盘弹出,会将View整体上移,解决方法?
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
或AndroidManifest.xml文件中界面对应的里加入
android:windowSoftInputMode="adjustPan" 键盘就会覆盖屏幕
android:windowSoftInputMode="stateVisible|adjustResize" 屏幕整体上移
2,ScrollView使用时,如果子View的高度较小时,ScrollView高度也会跟着变小,如果此时想让ScrollView充满屏幕?
在Layout中设置ScrollView属性
android:fillViewport="true"
3,在使用ListView的时候,需要将一个layout文件添加到listview的头部,layout文件设置的高度和失效
View headView = LayoutInflater.from(context).inflate(R.layout.list_head_view,null);
mListView.addHeaderView(headView);
想让layout中高度生效正确做法
View headView = LayoutInflater.from(context).inflate(R.layout.list_head_view,mListView,flase);
mListView.addHeaderView(headView);