1

以下は、私の xml コードの一部です。

<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

ここに画像の説明を入力

4

1 に答える 1

0

これは古い質問であることは知っていますが、ここに答えがあります。

問題は、あなたの XML コードで、geustureOverlayView android:layout_width="match_parent" android:layout_height="wrap_content" の次の寸法があることです。

これは、一部のコンテンツを指定するまで、高さがビュー全体に伸びても、高さが 0dp になることを意味します。幅は親と一致します。

これを表示する方法は、テキストまたはその他のコンテンツを追加することです。

または、GestureOverlayView に高さと背景色を指定すると、表示されるようになります。

于 2015-07-03T08:50:11.337 に答える