我已經使用hacky解決方案修復了它。我添加了另一個按鈕,並調用PinIt按鈕的OnClickEvent,並使按鈕可見性消失。
holder.mPinterestButton = ((PinItButton) holder.content.findViewById(R.id.pin_it));
holder.mPinterestButton.setImageUrl("http://placekitten.com/400/300");
holder.mPinterestButton.setUrl("http://placekitten.com"); // optional
holder.mPinterestButton.setDescription("A place kitten!"); // optional
holder.pinterestButton = ((Button) holder.content.findViewById(R.id.car_info_comment_pinterest));
holder.pinterestButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
holder.mPinterestButton.performClick();
}
});
XML:
<Button
android:id="@+id/car_info_comment_pinterest"
android:layout_width="@dimen/car_info_button_width"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_comment_pinterest"
android:background="@null"
android:text="100"
android:textColor="#fff" />
<com.pinterest.pinit.PinItButton
android:id="@+id/pin_it"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
/>