开发者

How to set the orientation of the views underneath the Gesture Overlay to "none"

I am trying to set the orientation of the views underneath the GestureOverlay to none. At this point I am able to set the orientation to either vertical or horizontal. However, for my application I dont want either, this needs to be set to none.

In the article for gestures API, it says the following:

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.

And above that it shows this piece of code, displaying the android:orientation as vertical.

<android.gesture.GestureOverlayView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gestures"
android:layout_width="fill_parent"
android:layout_hei开发者_开发百科ght="fill_parent"

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

After searching online I found this piece of code for an Android Theme that uses android:orientation="none"

So I tried to implement this into my GestureOverlay, however when I use this it just produces this error in the XML file: error: Error: String types not allowed (at 'orientation' with value 'none'). My code is shown below:

    <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"/>

Could someone let me know if there is a work around, or if this is a SDK version problem. I am coding using SDK version 7 (2.1.1).

Thanks


The android:orientation="none" option is part of the Replicant project and isn't valid for standard Android builds. In short, the only options you have are horizontal and vertical, sorry.


It looks to me like you're trying have both horizontal and vertical gestures being recognized using GestureOverlayView. This is the solution:

gestureOverlayView.setOrientation(GestureOverlayView.ORIENTATION_VERTICAL);
gestureOverlayView.setGestureStrokeAngleThreshold(90); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜