framelayout 안에 두개의 relativelayout이 있습니다.


framelayout을 onTouchListener 이벤트 등록을 했습니다.


e.getAction()했을 때 

MotionEvent.ACTION_DOWN은 먹히는데

MotionEvent.ACTION_UP은 안먹히는거 같습니다.


아래 소스를 보시고 한번 검토해주세요..


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="fill_parent"

    android:layout_height="fill_parent"

    android:orientation="vertical"

    tools:context=".MainActivity" >


    <FrameLayout

        android:id="@+id/frame"

        android:layout_width="300dp"

        android:layout_height="300dp" >


        <RelativeLayout

            android:layout_width="200dp"

            android:layout_height="300dp"

            android:background="#ff0000" >


            <RelativeLayout

                android:layout_width="200dp"

                android:layout_height="200dp"

                android:background="#ffff00" >

            </RelativeLayout>

        </RelativeLayout>

    </FrameLayout>


    <TextView

        android:id="@+id/tv"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:text="test" />


</LinearLayout>

-----------------------------------------------------------------------------


package com.testframe;


import android.app.Activity;

import android.os.Bundle;

import android.view.MotionEvent;

import android.view.View;

import android.view.View.OnTouchListener;

import android.widget.FrameLayout;

import android.widget.TextView;


public class MainActivity extends Activity {


private TextView tv;


@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);


FrameLayout frm = (FrameLayout) findViewById(R.id.frame);


tv = (TextView) findViewById(R.id.tv);


frm.setOnTouchListener(new OnTouchListener() {


@Override

public boolean onTouch(View v, MotionEvent e) {


if (e.getAction() == MotionEvent.ACTION_DOWN) {


tv.setText("down");

} else if (e.getAction() == MotionEvent.ACTION_UP) {

tv.setText("up");

}


return false;

}

});


}


}





확장 컴포넌트 해서 Code Highlighter 하면 왜 깨질까용?