2013-04-17 113 views
1

以下是我的XML代码部分:android.gesture.GestureOverlayView不显示上的图形布局

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/table_detail" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:padding="16dp" 
    tools:context=".SignCheckFragment" > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" > 

     <android.gesture.GestureOverlayView 
      android:id="@+id/gestureOverlayView1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="16dp" > 
     </android.gesture.GestureOverlayView>   

     <TextView 
      android:id="@+id/label_subtotal" 
      style="?android:attr/textAppearanceMedium" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="@string/subtotal" /> 

下图是相应的图形布局。问题是,有没有GestureOverlayView

enter image description here

回答

0

我知道这是一个老问题,但在这里是一个答案。

的问题是,在你的XML代码,您对gestureOverlayView Android的后续尺寸:layout_width =“match_parent” 机器人:layout_height =“WRAP_CONTENT”

这意味着,在您指定的某些内容的高度将是0dp,尽管它将一直延伸到视图中 - 宽度与父级匹配。

使其出现的方法是添加一些文本或其他内容。

或者给GestureOverlayView一些高度和背景颜色,它应该变得可见。