我有一个LinearLayout,它包含了几个按钮。为了让用户在屏幕上多(图)空间,我想隐藏在菜单中按这个LinearLayout中:Android:隐藏LinearLayout onKeyDown
if (keyCode == KeyEvent.KEYCODE_MENU) {
if (showButtons) {
showButtons = false;
LinearLayout lay = (LinearLayout) this.findViewById(R.id.buttonLayout);
laySize = lay.getHeight();
go2trimsecond();
} else {
showButtons = true;
go2trimsecond();
}
我以为我刚才保存的高度,如果(showButtons),布局的maxHeight更改为0并改变它回来如果(!showButtons),但不幸我错了,因为没有setMaxHeight。 任何想法我应该怎么做?
非常棒,非常感谢! – stefple
你的欢迎和继续..祝你好运 –