java中注释如何换行,java注释中空格和换行符的处理

java 注释换行写成

空格写成 

如:

/**

* 弹出操作确认对话框,弹出的确认框分为上下两部分,上面是一串提示文字,下面有左右两个操作按钮

*  -------------------------------

* |                                      |

* |                                      |

* |         提示消息                 |

* |                                      |

* |                                      |

* |------------------------------|

* |                    |                 |

* |      左按钮     |      右按钮  |

* |                    |                 |

*  -------------------------------

*

* @param msgTxt  显示在dialog上的提示消息

* @param leftButtonTxt 左下操作按钮的显示文字

* @param rightButtonTxt 右下操作按钮的显示文字

* @param leftButtonListener 左下操作按钮的点击回调

* @param rightButtonListener 右下操作按钮的点击回调

*/

private void showConfirmDialog(String msgTxt, String leftButtonTxt, String rightButtonTxt, final OnClickListener leftButtonListener, final OnClickListener rightButtonListener) {

final Dialog dialog = new Dialog(this,R.style.POSPassportDialog);

dialog.setCanceledOnTouchOutside(false);

dialog.setContentView(R.layout.dialog_confirm_no_title);

LayoutParams lp = dialog.getWindow().getAttributes();

lp.height = getResources().getDisplayMetrics().heightPixels/3;

dialog.getWindow().setAttributes(lp);

//弹窗显示的提示消息

TextView tv_msg = (TextView) dialog.findViewById(R.id.tv_msg);

tv_msg.setText(msgTxt);

//左边按钮的处理

final Button leftButton = (Button) dialog.findViewById(R.id.left_button);

leftButton.setText(leftButtonTxt);

leftButton.setOnClickListener(new OnClickListener() {

@Override

public void onClick(View v) {

if(leftButtonListener !=null){

leftButtonListener.onClick(leftButton);

}

dialog.cancel();

}

});

//右边按钮处理

final Button rightButton = (Button) dialog.findViewById(R.id.right_button);

rightButton.setText(rightButtonTxt);

rightButton.setOnClickListener(new OnClickListener() {

@Override

public void onClick(View v) {

if(rightButtonListener != null){

rightButtonListener.onClick(rightButton);

}

dialog.cancel();

}

});

dialog.show();

}

显示的效果:

0818b9ca8b590ca3270a3433284dd417.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值