2011-05-07 3 views
1

에 제스처 오버레이 아래에있는 뷰의 방향을 설정하는 방법. 이 시점에서 방향을 수직 또는 수평으로 설정할 수 있습니다. 그러나, 내 응용 프로그램 중 하나 싶지 않아,이 없음으로 설정해야합니다.내가 없음에 GestureOverlay 아래 뷰의 방향을 설정하려고 "없음"

orientation: indicates the scroll orientation of the views underneath. In this case the list scrolls vertically, which means that any horizontal gestures (like action_delete) can immediately be recognized as a gesture. Gestures that start with a vertical stroke must contain at least one horizontal component to be recognized. In other words, a simple vertical line cannot be recognized as a gesture since it would conflict with the list's scrolling.

을 그리고 그 위에 그것은 안드로이드 표시,이 코드 조각을 보여줍니다 : 제스처 API에 대한 article에서

, 다음 말한다 수직으로 방향을.

<android.gesture.GestureOverlayView 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/gestures" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 

android:gestureStrokeType="multiple" 
android:eventsInterceptionEnabled="true" 
android:orientation="vertical"> 

온라인 검색 후 나는이를 사용할 때, 그러나 그것은 단지 XML이 오류가 발생,

android:orientation="none" 그래서 내 GestureOverlay로이를 구현하려고 사용하는 안드로이드 테마에 대한 코드의 조각을 발견 파일 : 오류 : 오류 : 문자열 유형이 허용되지 않습니다 ('orientation'값 'none'). 내 코드는 다음과 같습니다

<android.gesture.GestureOverlayView 
android:id="@+id/gestures_alpha" 
android:layout_width="fill_parent" 
android:layout_height="0dip" 
android:layout_weight="1.0" 
android:gestureStrokeType="multiple" 
android:fadeOffset="2000" 
android:orientation="none"/> 

누군가는 일이 주변에있을 경우 알려주세요, 또는 수 이것은 SDK 버전 문제가있는 경우. SDK 버전 7 (2.1.1)을 사용하여 코딩하고 있습니다.

감사

+0

내가 좀 더 많은 정보를 [여기]를 발견 (http://gitorious.org/replicant/android_frameworks_base/commit/d98418db26a3af03d3c981efe3c4d5f6215327be) 이 코드는하지만 – Navigatron

답변

1

android:orientation="none" 옵션은 Replicant project의 일부이며 표준 안드로이드 빌드 유효하지 않습니다. 요컨대, 당신이 가지고있는 유일한 옵션은 수평적이고 수직입니다. 미안합니다. 당신은 수평과 수직 모두 제스처가 GestureOverlayView을 사용하여 인식되고있다하려는 것처럼

+0

그게 전부 불행한 어떻게 작동하는지 잘 모릅니다, 난 어떤 종류의 해결 방법이 있기를 바랬습니다. 어쨌든 고마워! – Navigatron

0

그것은 나에게 보인다. 이 솔루션입니다 :

gestureOverlayView.setOrientation(GestureOverlayView.ORIENTATION_VERTICAL); 
gestureOverlayView.setGestureStrokeAngleThreshold(90); 
관련 문제