안녕하세요.
ViewFlipper 을 사용하여 구현하려고 합니다.
아래의 XML을 보시면 UI가 상단 ViewFlipper 이 있고, 하단에는 리스트뷰로 화면을 전체 채웠습니다.
이렇다 보니 onTouchEvent 이 이벤트가 적용 되지 않습니다.
OnTouchListener 인터페이스를 상속을 받아
mFlipper = (ViewFlipper)findViewById(R.id.main_ViewFilpper);
mFlipper.setOnTouchListener(this);
@Override
public boolean onTouch(View v, MotionEvent event) {
Toast.makeText(getApplicationContext(), "제발좀 먹어라...... ㅜㅜ", Toast.LENGTH_SHORT).show();
return false;
}
이렇게 구현도 해보았지만 터치가 전혀 먹지를 않습니다......
ㅜㅜ 방법좀 도와주세요........ 도저히 모르겠습니다.......
좋은 하루 되세요..........
<LinearLayout
android:id="@+id/main_layoutList"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<ViewFlipper
android:id="@+id/main_ViewFilpper"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/main_btnEventBanner_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@null"
android:onClick="mOnClick"
android:src="@drawable/ad_1" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/main_btnEventBanner_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@null"
android:onClick="mOnClick"
android:src="@drawable/ad_2" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/main_btnEventBanner_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@null"
android:onClick="mOnClick"
android:src="@drawable/ad_3" />
</LinearLayout>
</ViewFlipper>
<ListView
android:id="@+id/main_listMain"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:divider="@color/color_list_line"
android:dividerHeight="1px" />
</LinearLayout>
mFlipper = (ViewFlipper)findViewById(R.id.main_ViewFilpper);
mFlipper.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
Toast.makeText(getApplicationContext(), "wasdfsdf", Toast.LENGTH_SHORT).show();
return false;
}
});
이것도 안되네요......... 개념이 없어서 그런데.... 좀 상세하게좀 말씀해 주시면 감사하겠습니다. ^^




this 로 하지말로 new로 해서 이벤트를 새로만들어야 하는거 아닌감요...?
플리퍼의 ontouch는 다르게 들어가는걸로 알고있는데..