我做了什么
我使用以下函数调整scrollview的大小(用作slidinglayout) 如果slidinglayout是地图片段,则第二个子节点。有一个按钮"从地图中选择"滑动视图完全隐藏的地方。
问题
问题是有时当我从地图中选择时。滑动布局折叠但地图片段没有正确扩展,它仍然像以前一样。这个白色的空间是左边的。
KeyBoard软输入未正确调整大小。我是usinf调整平底锅,但它扰乱了整个视图,滚动视图不滚动直到结束
public void resizeScrollView(final float slideOffset){
// The scrollViewHeight calculation would need to change based on what views are
// in the sliding panel. The calculation below works because the layout has
// 2 views. 1) The row with the drag view which is layout.getPanelHeight() high.
// 2) The ScrollView.
// Log.d("resizeScrollView - height %d panelHeight %d slideOffset %f", mySlidinglayout.getHeight(), mySlidinglayout.getPanelHeight(), slideOffset);
int scrollViewHeight = (int) mySlidinglayout.getPanelHeight();/*mySlidinglayout.getHeight() - mySlidinglayout.getPanelHeight()) * (1.0f - slideOffset)*/
if(slideOffset==0.0f)
{
scrollViewHeight=(int)(mySlidinglayout.getHeight());
}
final ViewGroup.LayoutParams currentLayoutParams = scrollView.getLayoutParams();
currentLayoutParams.height = scrollViewHeight-30;
scrollView.setLayoutParams(currentLayoutParams);
}