我有一个菜单 imageview,当点击它时,我的 linearlayout(line2) 出现,但它应该在下次点击菜单 imageview 时再次消失
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
line1=(LinearLayout) findViewById(R.id.ll1);
line2=(LinearLayout)findViewById(R.id.ll2);
menu=(ImageView)findViewById(R.id.menu);
menu.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
menu.setVisibility(View.VISIBLE);
// TODO Auto-generated method stub
line1.setVisibility(View.VISIBLE);
line2.setVisibility(View.VISIBLE);
}
});