Button hoursButton = (Button) findViewById(R.id.hours);
final AlertDialog.Builder openinghours = new AlertDialog.Builder(this);
hoursButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openinghours.setTitle("Opening Hours");
openinghours.setMessage(
"\nMonday: CLOSED"
+ "\nTuesday: CLOSED"
+ "\nWednesday: 22:00 - 3:00"
+ "\nThursday: CLOSED"
+ "\nFriday: 22:00 - 3:00"
+ "\nSaturday: 22:00 - 3:00"
+ "\nSunday: CLOSED");
openinghours.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
显示营业时间。我希望实际的营业时间以整齐的直线显示,它是这样显示的:
我正在尝试将字符串隔开,以便它看起来完全是笔直的、形成的线条。
必须有更好的方法来做到这一点?