我的目标:onclick隐藏主线性布局并在顶部可见
上制作另一个线性布局这是我的代码我可以运行onclick并使主线性布局隐藏但其他布局不显示
final LinearLayout jamesaionolayout = (LinearLayout) findViewById(R.id.jamesaionolayout);
final ImageView jamesaiono = (ImageView) findViewById(R.id.jamesaiono);
final LinearLayout textlayout = (LinearLayout) findViewById(R.id.text);
TextView roster = (TextView) findViewById(R.id.jamesaionotext);
roster.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
jamesaionolayout.setVisibility (View.VISIBLE);
jamesaiono.setVisibility (View.VISIBLE);
textlayout.setVisibility(View.INVISIBLE);
}
});
答案 0 :(得分:0)
将它设为textlayout.setVisibility(View.GONE);