Android nutiteq:按钮响应。可单击视图在自定义ViewLabel中不起作用

Android nutiteq:按钮响应。可单击视图在自定义ViewLabel中不起作用,android,custom-view,nutiteq,Android,Custom View,Nutiteq,我能够用Android nutiteq制作一个完全定制的ViewLabel,定义布局设计和尺寸。但是,可单击视图未按预期工作。首先,我试图通过将根布局定义为可点击来使整个标签可点击,但这不起作用。添加按钮也不起作用。如何解决这个问题 MapPos markerLoc = rasterLayer.getProjection().fromWgs84(lng, lat); Marker marker; CustomPOILayout layout = new CustomPOILayout(this

我能够用Android nutiteq制作一个完全定制的ViewLabel,定义布局设计和尺寸。但是,可单击视图未按预期工作。首先,我试图通过将根布局定义为可点击来使整个标签可点击,但这不起作用。添加按钮也不起作用。如何解决这个问题

MapPos markerLoc = rasterLayer.getProjection().fromWgs84(lng, lat);
Marker marker;

CustomPOILayout layout = new CustomPOILayout(this);
layout.setTitle((poi.title.trim().length() == 0)? "kein Titel" : poi.title);
layout.setDescription((poi.desc.trim().length() == 0)? "keine Beschreibung" : poi.desc);
layout.setDateAndAuthor(COSAHelper.convertTimestamp(poi.resCreated) + "\nvon: " + poi.author);
layout.setImages(poi.byteStrings);

layout.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
                        MeasureSpec.makeMeasureSpec(0,  MeasureSpec.UNSPECIFIED)); 
layout.layout(0, 0, layout.getMeasuredWidth(), layout.getMeasuredHeight());

Label label = new ViewLabel("", layout, 
                            new Handler(), 
                            LabelStyle.builder()
                                .setAlpha(1.0f)
                                .setBorderRadius(0)
                                .setBorderColor(Color.GRAY)
                                .setBorderWidth(5)
                                .build()
                            );


marker = new Marker(markerLoc, label, markerStyle3, markerLayer);
markerLayer.add(marker);
xml布局



如果我理解正确,是否希望将所有单击转发到标签内的视图ViewLabel有此方法:setTouchHandlingMode。只需调用viewLabel.setTouchHandlingMode(true)

这没有帮助,按钮仍然不会被按下唯一的区别是,如果拖动运动在标签内部开始,贴图不会被拖动
<TextView 
    android:id="@+id/label_title"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="18sp"
    android:textStyle="bold"
    />

<View 
    android:layout_width="match_parent"
    android:layout_height="1dip"
    android:background="@color/abc_search_url_text_normal"
    />

<TextView 
    android:id="@+id/label_date"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="11sp"
    />

<TextView 
    android:id="@+id/label_description"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="14sp"
    />

<View 
    android:layout_width="match_parent"
    android:layout_height="1dip"
    android:background="@color/abc_search_url_text_normal"
    />

<LinearLayout 
    android:id="@+id/label_container1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    >
    <ImageView 
        android:layout_width="0dip"
        android:layout_weight="1"
        android:layout_height="match_parent"
        android:adjustViewBounds="true"
        android:layout_margin="5dip"
        android:minHeight="25dip"
        />

    <ImageView 
        android:layout_width="0dip"
        android:layout_weight="1"
        android:layout_height="match_parent"
        android:adjustViewBounds="true"
        android:layout_margin="5dip"
        android:minHeight="25dip"
        />
</LinearLayout>

<LinearLayout 
    android:id="@+id/label_container2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    >
    <ImageView 
        android:layout_width="0dip"
        android:layout_weight="1"
        android:layout_height="match_parent"
        android:adjustViewBounds="true"
        android:layout_margin="5dip"
        android:minHeight="25dip"
        />

    <ImageView 
        android:layout_width="0dip"
        android:layout_weight="1"
        android:layout_height="match_parent"
        android:adjustViewBounds="true"
        android:layout_margin="5dip"
        android:minHeight="25dip"
        />
</LinearLayout>

<TextView 
    android:id="@+id/label_text_images"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textStyle="bold"
    />

<View 
    android:layout_width="match_parent"
    android:layout_height="1dip"
    android:background="@color/abc_search_url_text_normal"
    />

<Button 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="zeige Ressource"
    android:gravity="center"
    android:onClick="onClickTest"
    android:layout_gravity="center"
    android:textSize="14sp"/>