我有这个xml:
<com.me.view.button.SwipeableButton
android:id="@+id/mainMenuSwipeableButton"
android:layout_width="250dp"
android:layout_height="62dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="2dp"
android:layout_marginLeft="2dp"
app:button="@drawable/main_menu_button"
android:visibility="visible" />
和
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/icon_menu_press" /> <!-- pressed -->
<item android:drawable="@drawable/icon_menu" /> <!-- default -->
</selector>
当我有这个代码时,为什么我的点击不被抓住?
setCloseToolTipClickListener(getMainLayout().findViewById(R.id.mainMenuSwipeableButton), tooltipView);
private void setCloseToolTipClickListener(View view, final LinearLayout tooltip) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
tooltip.setVisibility(View.GONE);
}
});
}