Android 2.3.3에서 내 TextView
내에서 Touch 이벤트를 처리하는 데 문제가 있습니다. 나는 활동 방법 OnTouchListener
를 구현하고있어onTouchEvents를 처리 할 수있는 스크롤 막대가있는 TextView
main.java
public boolean onTouchEvent(MotionEvent event) {
if(event.getPointerCount()==1){
textView.setTextSize(mRatio+13);
mRatio++;
Log.d("TouchEvent", "one touch !");
}
if (event.getPointerCount() == 2) {
some code...
}
return true;
}
내 레이아웃 (그 부분 만) : 난 아무데도 내 텍스트 상자 밖에서 '클릭'
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1.0"
android:fadingEdge="none"
android:background="@color/white">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="10dp">
<!-- TEXT EMAIL : -->
<TextView
android:id="@+id/mail_text"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:textSize="15sp"
android:autoLink="web"
android:clickable="true"
android:textColor="@color/mailtext"
android:scrollbars = "vertical"/>
</LinearLayout>
</LinearLayout>
(예 : 머리글 또는 바닥 글), Touch 이벤트 트리거, 글꼴이 커집니다. 문제는 아마 스크롤바 때문이라고 생각합니다. 그러나 내가 android:scrollbars = "vertical"
막대를 자르면 사라집니다.
이 textView는 대개 많은 텍스트를 포함합니다.
이 텍스트 뷰 내에서 onTouchEvents를 올바르게 실행하는 방법.
편집 : 이 textView가 작 으면 touchEvent가 작아 져서 scrollBar가 필요한 텍스트를 얻을 수 있습니다. 그런 다음 모든 터치 이벤트가 무시되고 textView 만 스크롤 할 수 있습니다. TouchEvent가 호출되지 않습니다.
이 경우에는 작동하지 않습니다. –