listBtn.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mPage1.setVisibility(View.INVISIBLE);
mPage2.setVisibility(View.INVISIBLE);
listBtn.setVisibility(View.INVISIBLE);
coverBtn.setVisibility(View.INVISIBLE);
switch (v.getId()) {
case R.id.icon_list:
mPage2.setVisibility(View.VISIBLE);
coverBtn.setVisibility(View.VISIBLE);
break;
}
}
});
XML
LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/page1"
android:layout_margin="0px" android:textColor="#FFFFFF">
.
.
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/page2" android:visibility="invisible"
android:layout_margin="0px" android:textColor="#FFFFFF">
.
.
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mPage1.setVisibility(View.INVISIBLE);
mPage2.setVisibility(View.INVISIBLE);
listBtn.setVisibility(View.INVISIBLE);
coverBtn.setVisibility(View.INVISIBLE);
switch (v.getId()) {
case R.id.icon_list:
mPage2.setVisibility(View.VISIBLE);
coverBtn.setVisibility(View.VISIBLE);
break;
}
}
});
XML
LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/page1"
android:layout_margin="0px" android:textColor="#FFFFFF">
.
.
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/page2" android:visibility="invisible"
android:layout_margin="0px" android:textColor="#FFFFFF">
.
.
'개발도구 > aOS - 안드로이드 개발' 카테고리의 다른 글
[Android] Intent 활용 예시[펌] (0) | 2011.05.18 |
---|---|
OnClickListener (0) | 2011.05.18 |
iMovie 사용 블로그 추천 (0) | 2011.05.17 |
Rss listview (0) | 2011.05.17 |
안드로이드 프로그래밍 정복 (0) | 2011.05.17 |