Android GestureOverlayView隐藏其子项/隐藏在父项后面
我对手势叠加有问题 我设计了一个具有分割视图的画廊。除此之外,我还需要手势识别。 早些时候,我没有分割视图,所以当我使用手势叠加作为父视图时,它工作得很好。 但现在在拆分布局中,它并没有得到关注。请检查我是否做错了什么。 提前谢谢Android GestureOverlayView隐藏其子项/隐藏在父项后面,android,android-layout,view,android-gesture,Android,Android Layout,View,Android Gesture,我对手势叠加有问题 我设计了一个具有分割视图的画廊。除此之外,我还需要手势识别。 早些时候,我没有分割视图,所以当我使用手势叠加作为父视图时,它工作得很好。 但现在在拆分布局中,它并没有得到关注。请检查我是否做错了什么。 提前谢谢 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layou
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FF0000"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="2" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#0000FF"
android:orientation="vertical" >
<GridView
android:id="@+id/PhoneImageGrid"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:horizontalSpacing="5dp"
android:numColumns="1"
android:stretchMode="columnWidth"
android:verticalSpacing="5dp" />
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyleLargeInverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:indeterminateOnly="true"
android:visibility="gone" />
<VideoView
android:id="@+id/mVideoView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:keepScreenOn="true"
android:visibility="gone" />
<android.gesture.GestureOverlayView
android:id="@+id/gestures"
android:layout_width="0dp"
android:layout_height="match_parent"
android:eventsInterceptionEnabled="true"
android:gestureColor="#d80546"
android:gestureStrokeType="multiple"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#00FF00"
android:orientation="vertical" >
</LinearLayout>
//试试这个
如果GestureOverlayView不在RelativeLayout范围内,则可以正常工作
// try this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FF0000"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="2" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#0000FF"
android:gravity="center"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<GridView
android:id="@+id/PhoneImageGrid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:horizontalSpacing="5dp"
android:numColumns="1"
android:stretchMode="columnWidth"
android:verticalSpacing="5dp"
android:layout_centerInParent="true"
android:visibility="visible"/>
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyleLargeInverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminateOnly="true"
android:layout_centerInParent="true"
android:visibility="gone" />
<VideoView
android:id="@+id/mVideoView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:keepScreenOn="true"
android:layout_centerInParent="true"
android:visibility="gone" />
<android.gesture.GestureOverlayView
android:id="@+id/gestures"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:eventsInterceptionEnabled="true"
android:gestureColor="#FF0000"
android:layout_centerInParent="true"
android:gestureStrokeType="multiple"
android:orientation="vertical"
android:visibility="visible"/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#00FF00"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout>