我对油煎面包块有疑问:
customView = LayoutInflater.from(context).inflate(viewId, null);
if (customView != null) {
TextView title = (TextView) customView.findViewById(R.id.crouton_title);
if (title != null) {
title.setText(titleString);
}
TextView message = (TextView) customView.findViewById(R.id.crouton_message);
if (message != null) {
message.setText(messageString);
}
}
final Crouton crouton = Crouton.make((Activity) context, customView);
crouton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Crouton.hide(crouton);
}
});
如果我向 make 方法提供 customView,则永远不会调用 onClickListener。如果我使用makeText,它可以工作。难道我做错了什么?