我在约束布局的上方添加了约束布局,并且在其内部有一个按钮,当我点击它时,它应该使约束布局和按钮消失 并且这是代码防止旋转后出现视图
Button button11 = (Button) findViewById(R.id.button11);
final ConstraintLayout constraintLayout = (ConstraintLayout) findViewById(R.id.constraint_layout_inside);
button11.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
constraintLayout.setVisibility(View.INVISIBLE);
}
当我旋转屏幕约束布局再次出现时的问题 如何防止?
见[处理配置的变化(https://developer.android.com/guide/topics/resources /runtime-changes.html) – santalu