作者:多米音乐_35692689 | 来源:互联网 | 2023-05-19 16:50
Ihaveamenuimageview,whenclickedonitmylinearlayout(line2)appears,butitshouldagaindisa
I have a menu imageview, when clicked on it my linearlayout(line2) appears, but it should again disappear on the next click of menu imageview
我有一个菜单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);
}
});
2 个解决方案